SelectedIndexChanged - How do you test this only when user clicks it

emaduddeen

Well-known member
Joined
May 5, 2010
Messages
171
Location
Lowell, MA & Occasionally Indonesia
Programming Experience
Beginner
Hi Everyone,

I have a combo box and use the SelectedIndexChanged event. I noticed when I assign a value to the combo box that this event fires even though the user does not click on the control.

Can you tell me how to test for when the user clicks on it and actually selects a value from it?

Thanks.

Truly,
Emad
 
Hi JuggaloBrotha,

I see you are using VS 2010 on Windows7. I also have Windows7 64 bit Home Premium.

When you installed VS 2010, did you have any problems converting your VB 2008 applications?

Truly,
Emad
I haven't converted any projects to VS 2010 yet, but I have from 2003 to 2005 and from 2003 to 2008 before those worked fine, I can't think of a reason why VS 2010 wouldn't work as it just updates the xml nodes in the project & solution files.

I just happen to have VS 2010 installed and I've used it for a project a friend sent me, I use VS 2008 for primary development.
 
Delete that method and use the drop-down lists at the top of the code window. Select the control on the left and then the event on the right. Is SelectionChangeCommitted list for that control? Is that control definitely a ComboBox?
 
Hi jmcilhinney,

The control is a ComboBox from PureComponents and SelectionChangeCommitted is not listed in the DropDown on the top of the window. I submitted a request to them to include the event so in the mean time I started to use the ComboBox supplied by Microsoft and that does have the event.

The main thing I don't like about the Microsoft version of that control is it seems to pad blank rows in it and the user can click in those blank rows. I have another post asking how to stop the control from doing that. I also coded around it so VB won't return an error if the user clicks a blank row.

Truly,
Emad
 
The control is a ComboBox from PureComponents

That's rather important information to leave until now. If you just say "ComboBox" then everyone is going to assume that it's the standard .NET ComboBox control.
 
Check post 15, he mentioned it quite a while ago...

My humblest apologies then. I seem to have missed page 2 altogether because there's a bunch of posts there that I hadn't read. I'm guessing that I must have clicked a "first unread" link that jumped over a bunch of posts. While that's a reason, it's not an excuse.
 
Back
Top