Use the ComboBox control and add various values through the properties window in the Item part which lets you add them as a collection. The question I have is how can I make it so that when the application starts, the first option of the ComboBox is the first value that is added in the collection.
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Text = TextBox1.Text & " - " & ComboBox1.Text
End Sub
End Class
I follow the following:
Set the DropDownStyle property of the combobox as DropDownList is to do the following
with the two previous lines (in order of appearance) you indicate to the combobox that (let's say) restrict to the values in
item
and that it establishes the first element as selected (with -1 -minus one- you indicate none).I consider Roberto León Oramas's answer to be quite appropriate, but in the face of fellow Popplar's concern about "and where do I put the code".
Well, it could be in the Load Event of the Form you are working on.