quinta-feira, 4 de fevereiro de 2010

Ficha 22



Private Type pessoa
codigo As Integer
funcionario As String * 30
salario As Integer
vale As Integer
total As Integer
End Type
Dim tabela(12) As pessoa
Dim i As Integer, w As Integer

Private Sub Command1_Click()
If Text1 = "" Or Text2 = "" Or Text3 = "" Or Text4 = "" Or Text5 = "" Then
MsgBox "Preencha todos os campos"
Else
tabela(i).codigo = Val(Text1.Text)
tabela(i).funcionario = Text2.Text
tabela(i).salario = Val(Text3.Text)
tabela(i).vale = Val(Text4.Text)
tabela(i).total = Val(Text3.Text) + Val(Text4.Text)
Text5.Text = Val(Text3.Text) + Val(Text4.Text)
i = i + 1
w = i
End If
End Sub

Private Sub Command2_Click()
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Text5 = ""
End Sub

Private Sub Command3_Click()
Dim s As Integer
s = MsgBox(" Deseja mesmo sair?", vbYesNo + vbQuestion + vbDefaultButton2, " Pedido de confirmação")
If s = 6 Then
End
End If
End Sub

Private Sub Command4_Click()
If w > 0 Then
w = w - 1
ver_dados (w)
End If
End Sub

Private Sub Command5_Click()
If w < w =" w" text =" tabela(j).funcionario" text =" tabela(j).codigo" text =" tabela(j).salario" text =" tabela(j).vale" text =" tabela(j).total" interval =" 1000" caption = "##/##/####" caption =" Date" caption = "##:##:##" caption =" Time" caption =" Now" caption =" Time" sonumeros =" Key"> 9 Then
If InStr(Numeros$, Chr(Key)) = 0 Then
SoNumeros = 0
End If
End If
End Function

Private Sub Text1_KeyPress(KeyAscii As Integer)
KeyAscii = SoNumeros(KeyAscii)
End Sub
Private Sub Text3_KeyPress(KeyAscii As Integer)
KeyAscii = SoNumeros(KeyAscii)
End Sub
Private Sub Text4_KeyPress(KeyAscii As Integer)
KeyAscii = SoNumeros(KeyAscii)
End Sub

Sem comentários:

Enviar um comentário