Ver Mensaje Individual
  #22 (permalink)  
Antiguo 22/07/2011, 08:59
Avatar de HaverRamirez
HaverRamirez
 
Fecha de Ingreso: junio-2011
Ubicación: Guatemala
Mensajes: 273
Antigüedad: 12 años, 10 meses
Puntos: 33
Respuesta: Busqueda de clientes con combobox

En MSDN esta este ejemplo ve la validación

Código vb:
Ver original
  1. Private Sub ListBox1_SelectedValueChanged(ByVal sender As Object, ByVal e As EventArgs)
  2.         If ListBox1.SelectedIndex <> -1  Then
  3.             textBox1.Text = ListBox1.SelectedValue.ToString()
  4.             ' If we also wanted to get the displayed text we could use
  5.            ' the SelectedItem item property:
  6.            ' Dim s = CType(ListBox1.SelectedItem, USState).LongName
  7.        End If
  8.     End Sub 'ListBox1_SelectedValueChanged

ListBox1.SelectedIndex <> -1

http://msdn.microsoft.com/en-us/library/system.windows.forms.listcontrol.selectedvalue.asp x