I'm Every one
I've create a function That help me fill my combobox's, like this:
VB Code:
Public Sub FillComboBox(ByVal pCombo As System.Windows.Forms.ComboBox, ByVal pAccesBD As clsAccesDBSQL, ByVal pSQLQuery As String) Dim dt As DataTable dt = pAccesBD.GetDataSet(pSQLQuery).Tables(0) pCombo.DataSource = dt If dt.Rows.Count > 0 Then pCombo.BeginUpdate() pCombo.ValueMember = dt.Columns(0).ToString pCombo.DisplayMember = dt.Columns(1).ToString pCombo.EndUpdate() End If pCombo.SelectedIndex = -1 End Sub
My filled ComboBox, is on a TabControl on a Form, and when I switch to the second Tab and come back to the first tab, the First Item in my ComboBox is selected !?!?![]()
, I've absolutly no code "behind" that do so, and if I look to the SelectedIndex Before the tab switf it equal -1 after it's equal to 0
Do somebody can help ...![]()




Reply With Quote