I have 3 comboBoxes and the selectedIndexChanged event for all three call the
same method (ShowCorrectDisplay())....basically, the UI elements change
depending on which element is selected. However, the problem is that when my
form initially loads, the initially selected index of only combo box is
important....but my code calls the the ShowCorrectDisplay() method 3 times
during initial form load even though that is unneccessary. Is there any way
to do a check if (!formLoad) then ShowCorrectDisplay()?
Thanks.
Swami - 30 Aug 2005 17:41 GMT
Sorry, just correcting a sentence:
However, the problem is that when my
> form initially loads, the initially selected index of only ONE combo box is
> important.
> I have 3 comboBoxes and the selectedIndexChanged event for all three call the
> same method (ShowCorrectDisplay())....basically, the UI elements change
[quoted text clipped - 5 lines]
>
> Thanks.
John Bailo - 30 Aug 2005 17:47 GMT
Here's what I do.
Don't connect the selectedIndexChanged event handlers until after form load.
> I have 3 comboBoxes and the selectedIndexChanged event for all three call the
> same method (ShowCorrectDisplay())....basically, the UI elements change
[quoted text clipped - 5 lines]
>
> Thanks.
Swami - 30 Aug 2005 17:58 GMT
oh, you mean change the order of declarations??
> Here's what I do.
>
[quoted text clipped - 9 lines]
> >
> > Thanks.
Swami - 30 Aug 2005 17:58 GMT
How do you that?
> Here's what I do.
>
[quoted text clipped - 9 lines]
> >
> > Thanks.
John Bailo - 30 Aug 2005 19:25 GMT
Open up the section of code entitled:
#region Windows Form Designer generated code
Then find the statement
this.comboBox3.SelectedIndexChanged += new
System.EventHandler(this.comboBox3_SelectedIndexChanged);
And comment it out...//
Then copy this same statement to the point in your form load, after
you've populated the comboboxes.
> How do you that?
>
[quoted text clipped - 11 lines]
>>>
>>>Thanks.