What events to use when I want to select a list on the combo box and run a code.
Printable View
What events to use when I want to select a list on the combo box and run a code.
double click on the combo in your form, and it will open the changed property. you need to change that to the click property.
Decide what you want to happen, and code it there.
You can use the ListIndex property to determine what was clicked.
Just to mention that the click event of the combo box will be fired when an item is changed, not matter if it's clicked, selected by the keyboard or changed by code.
I think you mean the _Changed event manavo11. ;)
In the combobox? When the selected item is changed? The click event is fired... The changed event is fired when the text in the textbox part of the combo box is changed (if the style permits it). Come on Rob, you know better than that :D
Is .Net getting to your head? With all that fancy SelectionChanged events and stuff like that? :D
What? No its has only enhanced and heightened my skills :lol:
If you create an event for each, click and change, you can step through the code to see that if you click an item the click event fires and nothing else, no change event. ;)Quote:
Originally Posted by manavo11
What, brain fried from the exams. :p
But that's what I said :ehh: When the item changes, the _Click event is fired :confused:
Nope, when you "click" on an item the "Click" event is fired and not "Changed" event.
:DQuote:
Originally Posted by manavo11
OK, replace the word changed with "selection is altered" :)
:lol: Ok, how about "When an item is clicked upon". ;)
Not just clicked upon, cause the click event is fired when the selection is altered (;)) either by clicking, keyboard (arrows) or code (listindex altered) ;)