Click to See Complete Forum and Search --> : ComboBox SelectedIndex


kiran.k
June 11th, 2009, 05:50 AM
Is there any way to get the ComboBox SelectedIndex based on SelectedValue when Datasource property is set with DisplayMember and ValueMember?

sonia.sardana
June 14th, 2009, 03:06 PM
I dont now what are you saying about Datasource..ACtually not able to understand ur question..To get the index when the selected value changed..


Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ComboBox1.Items.Add("A")
ComboBox1.Items.Add("B")
ComboBox1.Items.Add("C")
End Sub

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
Dim lSelectedIndex As Integer
lSelectedIndex = ComboBox1.SelectedIndex
End Sub


R u asking this????