document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. \' Gambas class file
  2.  
  3. Public Sub _new()
  4.  
  5. End
  6.  
  7. Public Sub Form_Open()
  8.  
  9.   TextBoxNombre.SetFocus() \'asignamos el focus al textboxNombre cuando se inicia el programa
  10.  
  11. End
  12.  
  13. \'-----------------------------------------------
  14. \'cambiar el focus cuando se pulsa enter o return
  15. \'-----------------------------------------------
  16.  
  17. Public Sub TextBoxNombre_KeyPress()
  18.  
  19.   If Key.code = Key.Enter Or Key.code = Key.Return Then
  20.     TextBoxApellidos.SetFocus() \'envio el focus al textboxApellidos
  21.   Endif
  22.  
  23. End
  24.  
  25. Public Sub TextBoxApellidos_KeyPress()
  26.  
  27.   If Key.code = Key.Enter Or Key.code = Key.Return Then
  28.     ValueBoxEdad.SetFocus() \'envio el focus al textboxApellidos
  29.   Endif
  30.  
  31. End
  32.  
  33. Public Sub ValueBoxEdad_KeyPress()
  34.  
  35.   If Key.code = Key.Enter Or Key.code = Key.Return Then
  36.     ButtonAceptar.SetFocus() \'envio el focus al textboxApellidos
  37.   Endif
  38.  
  39. End
  40.  
  41. \'-----------------------------------------------
  42. \'Mensajes para cuando consigue o pierde el focus
  43. \'-----------------------------------------------
  44.  
  45. Public Sub TextBoxNombre_GotFocus()
  46.  
  47.   TextAreaFocus.text &= "TextBoxNombre tiene el focus\\n"
  48.  
  49. End
  50.  
  51. Public Sub TextBoxNombre_LostFocus()
  52.  
  53.   TextAreaFocus.text &= "TextBoxNombre pierde el focus\\n"
  54.  
  55. End
  56.  
  57. Public Sub TextBoxApellidos_GotFocus()
  58.  
  59.   TextAreaFocus.text &= "TextBoxApellidos tiene el focus\\n"
  60.  
  61. End
  62.  
  63. Public Sub TextBoxApellidos_LostFocus()
  64.  
  65.   TextAreaFocus.text &= "TextBoxApellidos pierde el focus\\n"
  66.  
  67. End
  68.  
  69. Public Sub ValueBoxEdad_GotFocus()
  70.  
  71.   TextAreaFocus.text &= "ValueBoxEdad gana el focus\\n"
  72.  
  73. End
  74.  
  75. Public Sub ValueBoxEdad_LostFocus()
  76.  
  77.   TextAreaFocus.text &= "ValueBoxEdad pierde el focus\\n"
  78.  
  79. End
  80.  
  81. Public Sub ButtonAceptar_GotFocus()
  82.  
  83.   TextAreaFocus.text &= "ButtonAceptar gana el focus\\n"
  84.  
  85. End
  86.  
  87. Public Sub ButtonAceptar_LostFocus()
  88.  
  89.   TextAreaFocus.text &= "ButtonAceptar pierde el focus\\n"
  90.  
  91. End
');