B
BillE
I am working on a vb.net windows forms project using visual studio 2005.
Often on the form load event I populate combo boxes.
When a combo box is populated, the SelectedIndexChanged event fires,
sometimes multiple times.
Usually the SelectedIndexChanged event runs code which should only run when
it is a user selection, not the result of the combo box being populated.
What I have been doing is defining a boolean class variable for the form to
indicate if the form has loaded completely, and setting it to True when the
form is completely loaded, in the form activated event. On each
SelectedIndexChanged event I check to see if this boolean variable is true,
before executing code.
Is this the best way to prevent control events from firing before the form
is completely loaded, or if there is a more efficient way?
Thanks
Bill
Often on the form load event I populate combo boxes.
When a combo box is populated, the SelectedIndexChanged event fires,
sometimes multiple times.
Usually the SelectedIndexChanged event runs code which should only run when
it is a user selection, not the result of the combo box being populated.
What I have been doing is defining a boolean class variable for the form to
indicate if the form has loaded completely, and setting it to True when the
form is completely loaded, in the form activated event. On each
SelectedIndexChanged event I check to see if this boolean variable is true,
before executing code.
Is this the best way to prevent control events from firing before the form
is completely loaded, or if there is a more efficient way?
Thanks
Bill