Está en la página 1de 3
' Gambas class file PUBLIC Control AS Boolean PUBLIC SUB Form_Open() ME.Center END PUBLIC SUB

' Gambas class file

PUBLIC Control AS Boolean

PUBLIC SUB Form_Open() ME.Center END

PUBLIC SUB Button1_Click() DIM C AS Integer C = 0 Control = TRUE IF Control = FALSE THEN RETURN

ListBox.Add(TextBox1.Text)

TextBox1.Text = ""

TextBox1.setFocus

C = C + ListBox.Count Message.Info("HA INSERTADO DATOS", C) END

PUBLIC SUB validar() IF TextBox1.Text = "" THEN Message.Info("debe escribir un nombre")

TextBox1.SetFocus

Control = FALSE ENDIF END

PUBLIC SUB Button2_Click() DIM C AS Integer C = 1

ListBox.Remove(0)

C = C + ListBox.Count Message.Info("HA ELIMINADO 1 DATO", C) END

PUBLIC SUB Button3_Click() DIM C AS Integer DIM cantidadltems AS Integer C = 0 cantidadltems = ListBox.Index IF cantidadltems >= 0 THEN ListBox.Remove(cantidadltems) C = C + ListBox.Count Message.Info("HA ELIMINADO EL DATO", C) ELSE IF ListBox.count > 0 AND cantidadltems = ­1 THEN Message.Info("debe seleccionar algo") ENDIF ENDIF END PUBLIC SUB ListBox_select() DIM resultado AS String resultado = Trim(ListBox.Text) Label2.Text = resultado & " FUE SELECCINADO "

END

PUBLIC SUB Button4_Click()

FMain.Show

ME.Close

END

PUBLIC SUB ListBox_Click()

END