How to not get combobox SelectedIndexChanged be executed on loadHello,<br>As what the subject line is.... What is the method to not allow combobox SelectedIndexChanged to be executed on load... and only make it to be executed when a &quot;USER&quot; changes the selection value.<br><br>Thanks<br>© 2009 Microsoft Corporation. All rights reserved.Thu, 19 Jun 2008 00:15:52 Zcbe96c98-beef-4abc-a268-3956064ece1chttp://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#cbe96c98-beef-4abc-a268-3956064ece1chttp://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#cbe96c98-beef-4abc-a268-3956064ece1cmrayyanhttp://social.msdn.microsoft.com/Profile/en-US/?user=mrayyanHow to not get combobox SelectedIndexChanged be executed on loadHello,<br>As what the subject line is.... What is the method to not allow combobox SelectedIndexChanged to be executed on load... and only make it to be executed when a &quot;USER&quot; changes the selection value.<br><br>Thanks<br>Wed, 05 Jul 2006 16:37:41 Z2006-07-25T13:56:35Zhttp://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#441f38c3-0d45-42a0-bd3d-9b1e7a2c270dhttp://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#441f38c3-0d45-42a0-bd3d-9b1e7a2c270dSJWhiteleyhttp://social.msdn.microsoft.com/Profile/en-US/?user=SJWhiteleyHow to not get combobox SelectedIndexChanged be executed on load<font face="Tahoma,Helvetica,Sans-Serif" size=2>Try using a boolean flag to indicate the'load' event, and check it in the selectionindexchanged event (exiting the event if the load is still in progress).</font>Wed, 05 Jul 2006 17:25:21 Z2006-07-05T17:25:21Zhttp://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#7943bf22-9dc9-4d99-9e24-3bee91dddc95http://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#7943bf22-9dc9-4d99-9e24-3bee91dddc95ahmedilyashttp://social.msdn.microsoft.com/Profile/en-US/?user=ahmedilyasHow to not get combobox SelectedIndexChanged be executed on loadwell it shouldnt change at all if nothing is making it change - perhaps you have some code invoking it to change the index selection of the comboboxWed, 05 Jul 2006 17:26:53 Z2006-07-05T17:26:53Zhttp://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#a1f950ef-dc0d-49f1-a42e-566f0d095730http://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#a1f950ef-dc0d-49f1-a42e-566f0d095730mrayyanhttp://social.msdn.microsoft.com/Profile/en-US/?user=mrayyanHow to not get combobox SelectedIndexChanged be executed on loadI do have it set to something else onload, but the selectedindexchanged loads it back to index 0.<br><br>but I might go ahead and do the bool thing, I doubt that will work because it will be a loop.<br><br>Wed, 05 Jul 2006 17:57:36 Z2006-07-05T17:57:36Zhttp://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#4e3f9628-3efa-49ce-a9e3-d3fddc5c77b7http://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#4e3f9628-3efa-49ce-a9e3-d3fddc5c77b7ahmedilyashttp://social.msdn.microsoft.com/Profile/en-US/?user=ahmedilyasHow to not get combobox SelectedIndexChanged be executed on load<p>doing the bool thing could be a temp solution but not best practice.</p> <p>What is this thing you are doing onload? perhaps you can do this process at some other point? If you can explain more in depth on what your code is doing onload, perhaps I/we can give you a better solution - if you would like :-)</p> <p> </p>Wed, 05 Jul 2006 18:48:16 Z2006-07-05T18:48:16Zhttp://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#81b9de0a-3367-43aa-99bc-b817a714e2b4http://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#81b9de0a-3367-43aa-99bc-b817a714e2b4SJWhiteleyhttp://social.msdn.microsoft.com/Profile/en-US/?user=SJWhiteleyHow to not get combobox SelectedIndexChanged be executed on load<p><font face="Tahoma,Helvetica,Sans-Serif" size=2>Why is the boolean flag not the best practice?</font></p> <p><font face="Tahoma,Helvetica,Sans-Serif" size=2>There isn't a way that I know of to prevent the SelectionIndexChanged if you change the index at load time.</font></p>Wed, 05 Jul 2006 19:47:17 Z2006-07-05T19:47:17Zhttp://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#475790fc-dad5-4627-9cca-66039cd69c38http://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#475790fc-dad5-4627-9cca-66039cd69c38ahmedilyashttp://social.msdn.microsoft.com/Profile/en-US/?user=ahmedilyasHow to not get combobox SelectedIndexChanged be executed on load<P>well anything can go wrong during that but should be kept as an absolute last resort&nbsp;:-) I am sure there is a better way of finding out why the developer (original poster) needs to alter the selected index at start up of the application (onload)</P> <P>&nbsp;</P> <P>I could post some examples but best not until we find out whats happening during onload, with some code :)</P>Wed, 05 Jul 2006 20:08:41 Z2006-07-05T20:08:41Zhttp://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#c714c742-3d64-4bae-8797-1c23ac9b4ca2http://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#c714c742-3d64-4bae-8797-1c23ac9b4ca2SJWhiteleyhttp://social.msdn.microsoft.com/Profile/en-US/?user=SJWhiteleyHow to not get combobox SelectedIndexChanged be executed on load<p><font face="Tahoma,Helvetica,Sans-Serif" size=2>I don't see that changing the index of a combo box at load time is at all unusual: unless you know of a better event to set a forms 'properties' <img src="images/emoticons/smile_regular.gif"></font></p> <p><font face="Tahoma,Helvetica,Sans-Serif" size=2>(For example, loading some settings into the form).</font></p> <p><font face="Tahoma,Helvetica,Sans-Serif" size=2>What I think is odd, though, is that it gets set back to zero: but this may be precisely the problem. Events are cascading during the form load. In which case the cascading effect needs short-circuiting; by putting a flag at the form level.</font></p> <p><font face="Tahoma,Helvetica,Sans-Serif" size=2>I can imagine the following in the form load event:</font></p> <p><font face="Courier New, Courier, Monospace" size=2>ComboBox1.SelectedIndex = 1</font></p> <p><font face="Tahoma,Helvetica,Sans-Serif" size=2>This will fire the SelectedIndexChanged event on the combobox. By having a 'loading' flag:</font></p> <p><font face="Courier New, Courier, Monospace" size=2>Private m_LoadingFlag as Boolean = True</font></p> <p><font face="Tahoma,Helvetica,Sans-Serif" size=2>at the form Class Level, you can look for this value in the comboBox SelectionIndexChanged event, before performing any processing:</font></p> <p><font face="Courier New, Courier, Monospace" size=2>if m_LoadingFlag then Return</font></p> <p><font face="Tahoma,Helvetica,Sans-Serif" size=2>At the end of the FormLoad event, the flag is set false.</font></p>Wed, 05 Jul 2006 20:19:19 Z2006-07-05T20:19:19Zhttp://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#ec8be2a3-344c-48d4-a4a7-68dd1f99cadbhttp://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#ec8be2a3-344c-48d4-a4a7-68dd1f99cadbahmedilyashttp://social.msdn.microsoft.com/Profile/en-US/?user=ahmedilyasHow to not get combobox SelectedIndexChanged be executed on load<p>Well yes that is true, but I am still trying to figure out why initially the index is being changed.</p> <p>If its done by the developer, then perhaps we can move that code to some other event rather than onload (so it doesnt change the index until some perhaps user action has happened).</p> <p>I think i'm getting a bit carried away, my pesonal preference is just interferring! :-) I just do things a bit differently myself, but yes you are right and I would perhaps do that. Although would be nice to see the onload code and see whats happening ;-)</p> <p> </p>Wed, 05 Jul 2006 20:24:12 Z2006-07-05T20:24:12Zhttp://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#29d1d1c7-029c-4e2b-8fb5-3c3f6719c73bhttp://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#29d1d1c7-029c-4e2b-8fb5-3c3f6719c73bmrayyanhttp://social.msdn.microsoft.com/Profile/en-US/?user=mrayyanHow to not get combobox SelectedIndexChanged be executed on loadWell, this is what is going on.<br><br>--OnLoad.. I am  populating the comboboxes and setting the selected value to the value of &quot;Term&quot; variable..... ex:<br>    [code]<br>    With Me.cboTerm<br>            .DataSource = Me.MiscDataTableTableAdapter.GetDataByTerm<br>            .DisplayMember = &quot;term&quot;<br>            .ValueMember = &quot;term&quot;<br>            .SelectedValue = Term<br>        End With<br>      [/code]<br><br>    and then I have the following:<br><br>[code]<br>Private Sub cboTerm_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboTerm.SelectedIndexChanged<br>        Term = CType(Me.cboTerm.SelectedItem, DataRowView).Item(&quot;term&quot;)<br>End Sub<br>[/code]<br><br>As you can see... in selectedIndexChange, it changes the variable Term onload, which it shouldnt.<br><br>I dont want selectedIndexChange to be executed onLoad.<br><br><br><br>Wed, 05 Jul 2006 20:43:22 Z2006-07-05T20:43:22Zhttp://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#21f3d45c-ad6a-4f9a-8e05-0ed7b2b9d0c4http://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#21f3d45c-ad6a-4f9a-8e05-0ed7b2b9d0c4ahmedilyashttp://social.msdn.microsoft.com/Profile/en-US/?user=ahmedilyasHow to not get combobox SelectedIndexChanged be executed on load<P>Why dont you set the SelectedIndex back to 0 after programmatically adding the values?</P> <P>Or you could also add a button for the user to press when they are ready to run the application, so it will only then go ahead and populate the values.</P> <P>If that is a bad idea, what about adding it through the designer? (Design view, select combo box, then in the properties window select items and add them) - if you do it this way, items get added and the selectedIndex does not change, pretty much making it not fire the SelectedIndexChange event which is what you would like, correct?</P> <P>&nbsp;</P> <P>Looking at the code again, I see that perhaps you are binding values from some source, comment out the .SelectedValue as I believe this is what is causing the SelectedIndexChanged to fire.</P> <P>&nbsp;</P> <P>The wierd thing is, I just tried a similar code as you had posted but never got the SelectedIndexChange to fire unless I explicitly change the index programmatically (comboBox.SelectedIndex = 1)</P>Wed, 05 Jul 2006 20:49:01 Z2006-07-05T20:49:01Zhttp://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#439df4ec-6eb5-4c69-95e1-df9cfd51df45http://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#439df4ec-6eb5-4c69-95e1-df9cfd51df45Jan Hydehttp://social.msdn.microsoft.com/Profile/en-US/?user=Jan%20HydeHow to not get combobox SelectedIndexChanged be executed on load<p>Using a flag has been the standard way to deal with this issue for years. </p> <p>It's not that the event 'should not be fired' it's 'you don't want it to' </p> <p>Implement the flag option.</p>Wed, 05 Jul 2006 20:49:38 Z2006-07-05T20:49:38Zhttp://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#f225d847-e733-4fc3-a2dc-d65f5d9ef83chttp://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#f225d847-e733-4fc3-a2dc-d65f5d9ef83cahmedilyashttp://social.msdn.microsoft.com/Profile/en-US/?user=ahmedilyasHow to not get combobox SelectedIndexChanged be executed on loadSure, I think I went a bit too overboard! My apologese! :-)Wed, 05 Jul 2006 20:53:07 Z2006-07-05T20:53:07Zhttp://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#83cb488f-805f-4b8c-b370-c7f01ef29689http://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#83cb488f-805f-4b8c-b370-c7f01ef29689SJWhiteleyhttp://social.msdn.microsoft.com/Profile/en-US/?user=SJWhiteleyHow to not get combobox SelectedIndexChanged be executed on load<font face="Tahoma,Helvetica,Sans-Serif" size=2>And here I was thinking I'd missed something... <img src="images/emoticons/smile_regular.gif"></font>Wed, 05 Jul 2006 22:57:53 Z2006-07-05T22:57:53Zhttp://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#c1e0544e-5eb0-450f-b9cc-a62507da840fhttp://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#c1e0544e-5eb0-450f-b9cc-a62507da840fRabtokhttp://social.msdn.microsoft.com/Profile/en-US/?user=RabtokHow to not get combobox SelectedIndexChanged be executed on load<p>Why not set the handler for the event to nothing, load the control, then set the handler to the routine you want to handle the event, a lot simpler than watching booleans and also reduces execution time as the handler is not executed for each add.</p><br><p>Try:</p><p><span id="_ctl0_MainContent_PostFlatView"><span>[code]</span></span></p><p><span id="_ctl0_MainContent_PostFlatView"><span>RemoveHandler </span></span><span id="_ctl0_MainContent_PostFlatView"><span>cboTerm.SelectedIndexChanged, addressof </span></span><span id="_ctl0_MainContent_PostFlatView"><span>cboTerm</span></span><span id="_ctl0_MainContent_PostFlatView"><span></span></span></p><p><span id="_ctl0_MainContent_PostFlatView"><span>&nbsp;&nbsp;&nbsp; With Me.cboTerm<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .DataSource = Me.MiscDataTableTableAdapter.GetDataByTerm<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .DisplayMember = "term"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .ValueMember = "term"<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .SelectedValue = Term<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End With</span></span></p> <p><span id="_ctl0_MainContent_PostFlatView"><span></span></span><span id="_ctl0_MainContent_PostFlatView"><span>AddHandler </span></span><span id="_ctl0_MainContent_PostFlatView"><span>cboTerm.SelectedIndexChanged, addressof </span></span><span id="_ctl0_MainContent_PostFlatView"><span>cboTerm</span></span></p> <p><span id="_ctl0_MainContent_PostFlatView"><span>[/code]</span></span></p> <p><span id="_ctl0_MainContent_PostFlatView"><span>The only extra thing you may then need to do is add a test that items are in the list and select the first member if you want the event to fire to fill in other parts of the form.<br> </span></span></p> <p><span id="_ctl0_MainContent_PostFlatView"><span>Thanks for this question, I have a form interface to our web orders and it loads several lists. Did a walkthrough of the loading and noticed it firing off the handlers for each item loading, complete waste of time. Disabling the handlers, loading the lists, enable handlers and select first item </span></span><span id="_ctl0_MainContent_PostFlatView"><span>perceptably </span></span><span id="_ctl0_MainContent_PostFlatView"><span>speeds up loading.<br> <br></span></span></p> Thu, 20 Jul 2006 12:39:27 Z2006-07-20T12:39:27Zhttp://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#ec6b1813-2d05-4ebf-9b2f-c663a32d9c11http://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#ec6b1813-2d05-4ebf-9b2f-c663a32d9c11Anarchyhttp://social.msdn.microsoft.com/Profile/en-US/?user=AnarchyHow to not get combobox SelectedIndexChanged be executed on loadI agree with Mr Whitely.  There are loads of reasons why you would want to set the selectedIndex of a drop-down during startup, and I've used booleans to do exactly this many times without any problem, I see no reason not to use this approach, and one good reason to use it: It's simple<br>Mon, 24 Jul 2006 13:12:44 Z2006-07-24T13:12:44Zhttp://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#c6276ae8-88b6-47a1-83f9-5b4bb1c26fb3http://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#c6276ae8-88b6-47a1-83f9-5b4bb1c26fb3Rabtokhttp://social.msdn.microsoft.com/Profile/en-US/?user=RabtokHow to not get combobox SelectedIndexChanged be executed on load<p>I agree there are many reasons not to action the selectedindexchange event during a load.</p><p> Using booleans is fine no sweat, however the code for the eventhandler still executes, what is simpler than not executing it at all, no booleans and no code execution overhead?<br></p>Tue, 25 Jul 2006 08:02:43 Z2006-07-25T08:02:43Zhttp://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#38f59df1-fc8b-41ce-8d8c-67e782dd6291http://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#38f59df1-fc8b-41ce-8d8c-67e782dd6291Jan Hydehttp://social.msdn.microsoft.com/Profile/en-US/?user=Jan%20HydeHow to not get combobox SelectedIndexChanged be executed on load<p>Normal use isn't to trap user events, normal use is to trigger whenever the event happens. The event handler does exactly what it's suposed to, fire whenever the event happens. It would lead to some buggy code if events stopped firing when you set someting in code, expecting the coder to explicitly call an event handler each time they set the property (assuming they can call it, or even know it exists)</p> <p> </p> <p> </p>Tue, 25 Jul 2006 08:12:36 Z2006-07-25T08:12:36Zhttp://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#bcc22f7a-ea87-4ff3-90c9-349fd07eb5e0http://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#bcc22f7a-ea87-4ff3-90c9-349fd07eb5e0SJWhiteleyhttp://social.msdn.microsoft.com/Profile/en-US/?user=SJWhiteleyHow to not get combobox SelectedIndexChanged be executed on load<p><font face="Tahoma,Helvetica,Sans-Serif" size=2>Actually, I've been thinking about this issue for a few days, now.</font></p> <p><font face="Tahoma,Helvetica,Sans-Serif" size=2>The ability to add and remove handlers is very powerful, and has made coding a few things very easy (adding/removing handlers dynamically to objects created on a whim - nice). I thought I'd give it a try in this situation.</font></p> <p><font face="Tahoma,Helvetica,Sans-Serif" size=2>Having played around with it, there are two things:</font></p> <p><font face="Tahoma,Helvetica,Sans-Serif" size=2>1. It works</font></p> <p><font face="Tahoma,Helvetica,Sans-Serif" size=2>2. It's confusing as heck.</font></p> <p><font face="Tahoma,Helvetica,Sans-Serif" size=2>The .NET framework allows us to do a lot of things - basically gives the programmer enough rope to climb in a hole but not out again. Just because you can, doesn't mean you should.</font></p> <p><font face="Tahoma,Helvetica,Sans-Serif" size=2>I resorted back to the flag method, leaving the handlers alone - it's much more readable (as long as you call your flag something readable...) and doesn't add any overhead at all.</font></p> <p><font face="Tahoma,Helvetica,Sans-Serif" size=2>Once a program becomes extensive, troubleshooting the add/remove handler can become a significant problem. In much the same way that old GDI programmers had to add and remove GDI objects (ugh - I don't know how many times the graphics screwed up on my computer due to funky memory leaks).</font></p> <p><font face=Verdana></font> </p>Tue, 25 Jul 2006 11:49:19 Z2006-07-25T13:56:35Zhttp://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#725923fa-9187-4f3c-8515-013b34f72014http://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#725923fa-9187-4f3c-8515-013b34f72014rotexdegbahttp://social.msdn.microsoft.com/Profile/en-US/?user=rotexdegbaHow to not get combobox SelectedIndexChanged be executed on loadTry setting your event SelectedIndexChanged handler after setting the data source. <span style="font-weight:bold;font-style:italic">Make sure you remove the SelectedIndexChanged  event handler set by the windows form designer from your form's constructor</span>. <br><br>This is what your code should look like:<br><br> myComboBox.DataSource = dataSource;<br>myComboBox.DisplayMember = &quot;displayMember&quot;;<br>myComboBox.ValueMember = &quot;valueMember&quot;;<br><span style="font-weight:bold"> this.myComboBox.SelectedIndexChanged += new System.EventHandler(this.myComboBox_SelectedIndexChanged);</span><br><br>Assuming <br><span style="font-weight:bold;font-style:italic">private void myComboBox_SelectedIndexChanged(object sender, EventArgs e)<br>{<br>       .......................<br>}<br></span><span style="font-style:italic"><span style="font-style:italic"></span></span>already exists.<span style="font-style:italic"><br></span>Wed, 24 Jan 2007 02:27:25 Z2007-01-24T02:27:25Zhttp://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#e3991263-c37f-4061-98c7-f6edd5fb587ahttp://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/cbe96c98-beef-4abc-a268-3956064ece1c#e3991263-c37f-4061-98c7-f6edd5fb587aNandemhttp://social.msdn.microsoft.com/Profile/en-US/?user=NandemHow to not get combobox SelectedIndexChanged be executed on load<font size=2><span style="font-family:Arial">Hi there.... my solution:<br><br><br>comboBox1.DataBindings.DefaultDataSourceUpdateMode = DataSourceUpdateMode.Never;<br>//This will solve u problem!<br></span></font>Sun, 20 Jan 2008 20:55:11 Z2008-01-20T20:55:11Z