I created a combobox with certain values in it, I need to read the selection from the combobox into a text box. Any suggestions to help me get started?

Recommended Answers

All 3 Replies

You begin your research reading the methods and properties from msdn (link) Look though the list of properties and method to find the one that returns the text from the selection field of the combobox. Then all you have to do is copy the text into a textbox (a simple assignment)

I could just tell you, but I won't because you need to learn how to find out those things for yourself. It's part of the learning process.

You should look at using the ComboBox_SelectedIndexChanged event.

This can be handled like so:

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles ComboBox1.SelectedIndexChanged
    Try
        TextBox1.Text = ComboBox1.SelectedValue
    Catch ex As Exception
        MsgBox(ex.ToString)
    End Try
End Sub

I wasn't looking for the code itself. I found part of the code I need, I just need a little push, thank you!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.