ComboBox

  • Thread starter Thread starter MadCrazyNewbie
  • Start date Start date
M

MadCrazyNewbie

Hey Group, Hope your all well?

If I have a comboBox how would i get is so that if i Select:

X in the combbbox how would i get it to display 1Test, in a Textbox1?
y in the combbbox how would i get it to display 2Test, in a Textbox1?
and
Z in the combbbox how would i get it to display 3Test, in a Textbox1?

Cheers
MCN
 
Hey Group, Hope your all well?

If I have a comboBox how would i get is so that if i Select:

X in the combbbox how would i get it to display 1Test, in a Textbox1?
y in the combbbox how would i get it to display 2Test, in a Textbox1?
and
Z in the combbbox how would i get it to display 3Test, in a Textbox1?

Cheers
MCN


Try this:

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ComboBox1.SelectedIndexChanged

Select Case ComboBox1.Items(ComboBox1.SelectedIndex).ToString
Case "X"
TextBox1.Text = "1Test"
Case "Y"
TextBox1.Text = "2Test"
Case "Z"
TextBox1.Text = "3Test"
End Select

End Sub

Hope this helps

Blu
 
Hi Simon,

Hundreds of possibilities, this one you should recognize which is very easy
to use.

I hope this helps?

Cor

\\\
Dim connArray As New ArrayList
Private Sub Form8_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Me.ComboBox1.Items.Add("X")
Me.ComboBox1.Items.Add("Y")
Me.ComboBox1.Items.Add("Z")
connArray.Add("1Test")
connArray.Add("2Test")
connArray.Add("3Test")
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal _
sender As Object, ByVal e As System.EventArgs) _
Handles ComboBox1.SelectedIndexChanged
Me.TextBox1.Text = connArray(ComboBox1.SelectedIndex).ToString
End Sub
///
 
Back
Top