Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ComboBox Events

Status
Not open for further replies.

MasterRacker

Active member
Oct 13, 1999
3,343
US
I was troubleshooting a problem on a form and seem to be seeing an unexpected behavior. It appears that the ComboBox SelectedValueChanged event fires even if you select the same item that was originally selected.

Is this really the case, and if so, why?

(This is only a minor annoyance, but it seems to me that this event should only go off when something different is chosen.)

Jeff
[purple]It's never too early to begin preparing for [/purple]International Talk Like a Pirate Day

"The software I buy sucks, The software I write sucks. It's time to give up and have a beer..." - Me
 
if you don't like this then create a class that extends combobox.

Override the SelectedValueChanged and determine if the index actually changed. If it does then call base.OnSelectedValueChanged(e); otherwise, don't bother.
 
It's not worth that much to me. I was just wondering if someone knew why that happens. To me a "changed" event shuold only fire if something actually changed. I can see a clicking on the same item firing a "click" or "select" event, but not a "changed" event.

Like I said, in my app, this is a minor annoyance. I have plenty of more important things to stress about. ;-)

Jeff
[purple]It's never too early to begin preparing for [/purple]International Talk Like a Pirate Day

"The software I buy sucks, The software I write sucks. It's time to give up and have a beer..." - Me
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top