Ver Mensaje Individual
  #2 (permalink)  
Antiguo 20/07/2011, 07:05
Avatar de lokoman
lokoman
 
Fecha de Ingreso: septiembre-2009
Mensajes: 502
Antigüedad: 14 años, 7 meses
Puntos: 47
Respuesta: Como hacer para validar un textbox?

Hola!
Antes que nada, verifica la propiedad 'TabIndex' de cada text, la cual debe estar en secuencia, para que al mandar el "TAB" no esté saltando entre los text como loco.

Código vb:
Ver original
  1. Private Sub txtText1_KeyPress(KeyAscii As Integer)
  2.     If KeyAscii = 13 Then SendKeys "{TAB}"
  3. End Sub
  4.  
  5. Private Sub txtText1_LostFocus()
  6.     If Trim(txtText1.Text) = Empty Then
  7.         MsgBox "No puede estar en blanco!", vbInformation
  8.         txtText1.SetFocus
  9.     End If
  10. End Sub

Nos cuentas!