You are on page 1of 5

Identificación de objetos:

Cantidad Descripción
1 Form
5 Label
5 Text
5 List Box
4 Command

Asignar Propiedades:

Form
Name: frmindicadores
Caption: Indicadores CTC

Label 1
Name: lblnombre
Caption: Nombre

Label 2
Name: lblnumero
Caption: Numero de Empleado

Label 3
Name: lblarea
Caption: Área de trabajo

Label 4
Name: lblccc
Caption: Participación mensual de CCC

Label 5
Name: lblpm
Caption: Participación mensual de Pequeñas Mejoras

Text 1
Name: txtnombre
Caption: “”

Text 2
Name: txtnumero
Caption:””

Text 3
Name: txtarea
Caption: “”

Text 4
Name: txtccc
Caption: “”

Text 5
Name: txtpm
Caption: “”

List Box 1
Name: lstnombre
Caption: “”

List Box 2
Name: lstnumero
Caption: “”

List Box 3
Name: lstarea
Caption:””

List Box4
Name: lstccc
Caption: “”
List Box 5
Name: lstpm
Caption: “”

Command 1
Name: Cmdinsertar
Caption: &Insertar

Command 2
Name: Cmdmostrar
Caption: &Mostrar

Command 3
Name: Cmdlimpiar
Caption: &Limpiar

Command 4
Name: Cmdsalir
Caption: &Salir
Código:

Dim i As Integer
Private Type indicadores
nombre As String
numero As Integer
area As String
ccc As Integer
pm As Integer
'Integer

End Type
Dim datos(1 To 5) As indicadores

Private Sub cmdinsertar_Click()


i=i+1

If txtnombre.Text = "" Or txtnumero.Text = "" _


Or txtarea.Text = "" Or txtccc.Text = "" Or txtpm.Text = "" Then
MsgBox "Faltan datos", vbOKOnly, _
"Mensaje de sistema"
i=0

Else
If i <= 5 Then
datos(i).nombre = txtnombre.Text
datos(i).numero = txtnumero.Text
datos(i).area = txtarea.Text
datos(i).ccc = txtccc.Text
datos(i).pm = txtpm.Text
txtnombre.Text = ""
txtnumero.Text = ""
txtarea.Text = ""
txtccc.Text = ""
txtpm.Text = ""
txtnombre.SetFocus
Else
MsgBox "lista llena", vbOKOnly, _
"Mensaje de sistema"
txtnombre.Enabled = False
txtnumero.Enabled = False
txtarea.Enabled = False
txtccc.Enabled = False
txtpm.Enabled = False
End If
End If
End Sub

Private Sub cmdlimpiar_Click()


txtnombre.Text = ""
txtnumero.Text = ""
txtarea.Text = ""
txtccc.Text = ""
txtpm.Text = ""
lstnombre.Clear
lstnumero.Clear
lstarea.Clear
lstccc.Clear
lstpm.Clear
txtnombre.Enabled = True
txtnumero.Enabled = True
txtarea.Enabled = True
txtccc.Enabled = True
txtpm.Enabled = True
i=0
Erase datos()
txtnombre.SetFocus

End Sub

Private Sub cmdmostrar_Click()


For i = 1 To 5
lstnombre.AddItem (datos(i).nombre)
lstnumero.AddItem (datos(i).numero)
lstarea.AddItem (datos(i).area)
lstccc.AddItem (datos(i).ccc)
lstpm.AddItem (datos(i).pm)
Next i

End Sub

Private Sub cmdsalir_Click()


End
End Sub

You might also like