ComponentOne Input for WinForms
Displaying Clicked C1DropDown Buttons in a Text Box
Input for WinForms Task-Based Help > Displaying Clicked C1DropDown Buttons in a Text Box

To display clicked C1DropDownControl buttons in a text box, use the C1DropDownControl.UpDownButtonClick event. In this example, the output will be displayed in a textbox (TextBox1).

To write code in Visual Basic

Visual Basic
Copy Code
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

To write code in C#

C#
Copy Code
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");
    }
}

This topic illustrates the following:

When the Up or Down buttons are clicked in the C1DropDownControl, the words Up or Down will appear in a textbox to indicated which button was pressed.


See Also