Input for WinForms的基于任务的帮助 > 在文本框中显示点击的 C1DropDown 控件按钮 |
为了能够显示点击的 C1DropDown 控件按钮,需要使用C1DropDownControl 的 UpDownButtonClick事件,在下面的例子中点击的按钮会显示在文本框中。
Visual Basic
Visual Basic |
拷贝代码
|
---|---|
Private Sub C1DropDownControl1_UpDownButtonClick(ByVal sender As Object, ByVal e As C1.Win.C1Input.UpDownButtonClickEventArgs) Handles C1DropDownControl1.UpDownButtonClick If (e.Delta = 1) Then Me.TextBox1.AppendText("Up " & ControlChars.CrLf) ElseIf (e.Delta = -1) Then Me.TextBox1.AppendText("Down " & ControlChars.CrLf) End If End Sub |
C#
C# |
拷贝代码
|
---|---|
private void c1DropDownControl1_UpDownButtonClick(object sender, C1.Win.C1Input.UpDownButtonClickEventArgs e) { if ((e.Delta == 1)) { this.textBox1.AppendText("Up\r\n"); } else if ((e.Delta == -1)) { this.textBox1.AppendText("Down\r\n"); } } |
当C1DropDownControl 控件的上或者下按钮被点击的时候,文本“Up”或者“Down”会显示在文本框中,用来显示那个按钮被点击。