Link to home
Start Free TrialLog in
Avatar of intikhabk
intikhabk

asked on

Get a Value from Combo Box in VB.NET Winforms

I have a Winforms application and using the code below to populate combo box

        Dim dt As New DataTable
        dt.Columns.Add(New DataColumn("Text", GetType(String)))
        dt.Columns.Add(New DataColumn("Value", GetType(String)))

        Dim dr As DataRow
        dr = dt.NewRow
        dr.Item("Text") = "Rocky"
        dr.Item("Value") = "11"
        dt.Rows.Add(dr)

        cmbProviders.DataSource = dt
        cmbProviders.DisplayMember = "Text"
        cmbProviders.ValueMember = "Value"

How do I get the value from the combo box on some button click
ASKER CERTIFIED SOLUTION
Avatar of Jorge Paulino
Jorge Paulino
Flag of Portugal image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial