Articles in this section
Category / Section

How to get a WinForms MultColumnComboBox to auto drop down when a user starts typing in the control?

1 min read

Handle the KeyPress event

You can handle the KeyPress event and set the DroppedDown property to true as shown below.

C#

private void multiColumnComboBox1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
    if(e.Handled ==false)
    {
        if(this.multiColumnComboBox1.DroppedDown == false)
        {
             this.multiColumnComboBox1.DroppedDown =true;
        }
    }
    else
    {
         this.multiColumnComboBox1.DroppedDown =false;
    }
}

 

VB

Private Sub multiColumnComboBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles multiColumnComboBox1.KeyPress
     If e.Handled =False Then
         If Me.multiColumnComboBox1.DroppedDown = False Then
             Me.multiColumnComboBox1.DroppedDown =True
         End If
     Else
         Me.multiColumnComboBox1.DroppedDown =False
     End If
End Sub

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied