غير الحدث من SelectedIndexChanged الى SelectionChangeCommitted
لا تنسى السطر ComboBox2_SelectionChangeCommitted(Nothing, Nothing)
PHP كود :
Private Sub ComboBox2_SelectionChangeCommitted(sender As Object, e As EventArgs) Handles ComboBox2.SelectionChangeCommitted
If ComboBox1.Text = "" Then
MessageBox.Show("قم بالاختيار اولا من الكومبوبوكس 1")
ComboBox2.SelectedIndex = -1
End If
If ComboBox1.SelectedIndex >= 0 AndAlso ComboBox2.SelectedIndex >= 0 Then
TextBox2.Text = n2(ComboBox1.SelectedIndex + 1, ComboBox2.SelectedIndex + 1)
End If
End Sub
لا تنسى السطر ComboBox2_SelectionChangeCommitted(Nothing, Nothing)
