Link to home
Create AccountLog 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
Create an account to see this answer
Signing up is free. No credit card required.
Create Account