Click here to Skip to main content
15,898,743 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I write a code on combobox value change event. I want to execute it only when I change my combobox value manually. But whenever I write code e.g. cmb1.text="" . At that instance the combobox change value event is executed. But I don't want it. I want it to execute only when I change the combobox value by clicking on that combobox.
Posted
Comments
[no name] 22-Nov-12 8:04am    
Can show show your code, so that I got more idea for your query ??
dcba1 22-Nov-12 8:15am    
Only want to execute that event when I click on combo box and change value manually.

1 solution

The SelectedIndexChanged event will fire when you set the Text to a value that exists in the dropdown list part of the combobox. If it is firing when you assign an empty string then there must be an empty string in the list.

A very useful event is SelectionChangeCommitted as this is raised only when the user changes the selection and not when values are changed programmatically.

SelectionChangeCommitted[^]

Alan.
 
Share this answer
 
Comments
dcba1 23-Nov-12 0:41am    
thanks... my problem is solved

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900