\' Gambas class file
Public Sub _new()
End
Public Sub Form_Open()
TextBoxNombre.SetFocus() \'asignamos el focus al textboxNombre cuando se inicia el programa
End
\'-----------------------------------------------
\'cambiar el focus cuando se pulsa enter o return
\'-----------------------------------------------
Public Sub TextBoxNombre_KeyPress()
If Key.code = Key.Enter Or Key.code = Key.Return Then
TextBoxApellidos.SetFocus() \'envio el focus al textboxApellidos
Endif
End
Public Sub TextBoxApellidos_KeyPress()
If Key.code = Key.Enter Or Key.code = Key.Return Then
ValueBoxEdad.SetFocus() \'envio el focus al textboxApellidos
Endif
End
Public Sub ValueBoxEdad_KeyPress()
If Key.code = Key.Enter Or Key.code = Key.Return Then
ButtonAceptar.SetFocus() \'envio el focus al textboxApellidos
Endif
End
\'-----------------------------------------------
\'Mensajes para cuando consigue o pierde el focus
\'-----------------------------------------------
Public Sub TextBoxNombre_GotFocus()
TextAreaFocus.text &= "TextBoxNombre tiene el focus\\n"
End
Public Sub TextBoxNombre_LostFocus()
TextAreaFocus.text &= "TextBoxNombre pierde el focus\\n"
End
Public Sub TextBoxApellidos_GotFocus()
TextAreaFocus.text &= "TextBoxApellidos tiene el focus\\n"
End
Public Sub TextBoxApellidos_LostFocus()
TextAreaFocus.text &= "TextBoxApellidos pierde el focus\\n"
End
Public Sub ValueBoxEdad_GotFocus()
TextAreaFocus.text &= "ValueBoxEdad gana el focus\\n"
End
Public Sub ValueBoxEdad_LostFocus()
TextAreaFocus.text &= "ValueBoxEdad pierde el focus\\n"
End
Public Sub ButtonAceptar_GotFocus()
TextAreaFocus.text &= "ButtonAceptar gana el focus\\n"
End
Public Sub ButtonAceptar_LostFocus()
TextAreaFocus.text &= "ButtonAceptar pierde el focus\\n"
End