Windows Develop Bookmark and Share   
 index > Windows Forms General > expand/open a combobox on focus in C#
 

expand/open a combobox on focus in C#

Hello again!

Is possible to expand/open a combobox when it is on focus?

In the events list I didn't found onFocus or something similar... Sad

Vanessa Barsottelli  Thursday, June 19, 2008 8:49 AM

Use the Enter event (=focus):

Code Snippet

private void comboBox1_Enter(object sender, EventArgs e)

{

comboBox1.DroppedDown = true;

}

private void comboBox1_Leave(object sender, EventArgs e)

{

comboBox1.DroppedDown = false;

}

Regards,

Fabio

Fábio Franco  Thursday, June 19, 2008 12:00 PM

Use the Enter event (=focus):

Code Snippet

private void comboBox1_Enter(object sender, EventArgs e)

{

comboBox1.DroppedDown = true;

}

private void comboBox1_Leave(object sender, EventArgs e)

{

comboBox1.DroppedDown = false;

}

Regards,

Fabio

Fábio Franco  Thursday, June 19, 2008 12:00 PM

It works!

Thanks Smile

Vanessa Barsottelli  Thursday, June 19, 2008 1:37 PM

You can use google to search for other answers

Custom Search

More Threads

• How to modify connection string in app.config?
• Show Word Document Preview inside Windows Form
• Custom AutoComplete filtering in ComboBox
• "files of type"
• Oh Progress Bar ????
• Documents w/ Web Services
• Multiple Buttons Using One Button_Click Event Method
• asp
• Change Assembly name cause error in reflection
• (URGENT) Proxy Authentication required for Windows Application