Using SelectionChangeCommitted event of ComboBox

12 May

If you want to capture changes in ComboBox you can use ‘SelectedIndexChanged’ or ‘SelectedValueChanged’ events. However, if you want to get changes only when the user changes the selection, use ‘SelectionChangeCommitted’ event instead.

SelectionChangeCommitted occurs only when the ComboBox selection changes by user (via keyboard or mouse) and it is not raised when the selection changes programmatically.

private void comboBox1_SelectionChangeCommitted(object sender, EventArgs e)
{
    if (comboBox1.SelectedIndex == 1)
    { 
        //do something...
    }
}
Advertisements

3 Responses to “Using SelectionChangeCommitted event of ComboBox”

  1. bar code printer June 18, 2013 at 2:05 pm #

    Its not my first time to pay a visit this site, i am browsing this website dailly and take fastidious
    data from here every day.

  2. Tony September 17, 2013 at 2:25 pm #

    The ComboBox WinForms Control allows users easily search and select data from multiple column list

  3. Xeperia November 16, 2014 at 7:57 pm #

    Short and sweet

Leave a Reply to bar code printer Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: