By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,652 Members | 1,487 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,652 IT Pros & Developers. It's quick & easy.

Take Action When Item Selected in Combo

P: n/a
As a newcomer to .Net I'm continually frustrated with the subtle and not so
subtle changes that have been made since VB 6.0 that don't seem to server
any real purpose other than to frustrate people like me. In any case, I'm
trying to do something as simple as take an action when the user selects an
item from a combo box. I've tried using the SelectedIndexChange event, but
that fires several times while the list is being populated etc. before the
form is even visible. The work around that I came up with is to set a
boolean flag when the user first clicks the control so that the desired
action in the SelectedIndexChange event is only taken after the control has
been clicked by the user. This seems like an ugly solution to me. Is there
a better way?

Bob
Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Robert A. Boudra" <rb*****@comcast.net> wrote in message
I've tried using the SelectedIndexChange event, but
that fires several times while the list is being populated etc. before the


Bob,

I have dealt with this issue by declaring "private mLoaded as
Boolean=False" at the class level then surrounding the
"SelectedIndexChanged" event action with "if mLoaded then..." It
isn't very elegant (you have to set mLoaded to true after your object
initialization code) but it is effective.

I have also learned that there are better approaches for some objects,
but I am not aware of one for the Combobox. Perhaps one of the more
knowledgeable regulars here can provide a better answer.

Charlie
Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.