Hi tnr64,
For me I was trying to select a name and then have a value associated with that name diplay in a label. This was the solution to my problem.
BTW: I was populating the names programmatically.
Option Strict On
Public Class Form3
Private intExtension As Integer
Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList
Me.ComboBox1.Items.Add("Smith, Joe")
Me.ComboBox1.Items.Add("Jones, Mary")
Me.ComboBox1.Items.Add("Arhed, Joel")
Me.ComboBox1.Items.Add("Lin, Sue")
Me.ComboBox1.Items.Add("Li, Vicky")
Me.ComboBox1.SelectedIndex = 0
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
If ComboBox1.SelectedItem Is "Smith, Joe" Then
intExtension = 3388
ElseIf ComboBox1.SelectedItem Is "Jones, Mary" Then
intExtension = 3356
ElseIf ComboBox1.SelectedItem Is "Arhed, Joel" Then
intExtension = 2366
ElseIf ComboBox1.SelectedItem Is "Lin, Sue" Then
intExtension = 1144
ElseIf ComboBox1.SelectedItem Is "Li, Vicky" Then
intExtension = 4320
End If
lblPhoneNumber.Text = "(555) 555- " & intExtension.ToString
End Sub
End Class
There probably is an easier way but this worked for my situation.