This is one weird glitch. I've searched the forums and the web, and still i have not found anyone else that has encountered this.
On a WinForm, drop on 2 ComboBoxes, and then place this code in behind it:
When you run the program and select something from either combo box, the code for both fires!VB Code:
Dim bFormLoading As Boolean = True Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim arText() As String = {"", "Red", "White", "Blue"} ComboBox1.DataSource = arText ComboBox2.DataSource = arText 'MsgBox("form_load") bFormLoading = False End Sub Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged If bFormLoading = False Then MsgBox("ComboBox1") End Sub Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged If bFormLoading = False Then MsgBox("ComboBox2") End Sub![]()
I think it's some kind of weird situation where .NET is re-drawing the form, and thus it is re-selecting an item in each combo box. But i'm not sure.
It's the weirdest thing i've ever seen.




Reply With Quote