domingo, 4 de mayo de 2008

Transacciones bancarias en Visual basic 6.0

' primero crear un formulario en visual basic 6.0, despues crear 7 etiquetas o labels para agregar el nombre del campo, seguidamente agregar 7 textbox, y 5 command buttons, posteriormente el nombre de las variables de los labels, commands y textbox, cambiarlos en la paleta de propiedades donde dice Nombre o Name, el nombre de los campos que verá el usuario en la interfaz, se cambian en la propiedad Caption, puedes dejar tu comentario si no entiendes como hacerlo, buena suerte.




Private Sub Command1_Click()
Form1.Show



End Sub

Private Sub cmdaceptar_Click()
Dim C As Integer, b200 As Integer, b100 As Integer
Dim cant, saldo As Integer
cant = 8000


Dim b50 As Integer, b20 As Integer, b10 As Integer
C = Val(txtcantidad)


If C Mod 10 = 0 Then

b200 = C \ 200: C = C Mod 200
b100 = C \ 100: C = C Mod 100
b50 = C \ 50: C = C Mod 50
b20 = C \ 20: C = C Mod 20
b10 = C \ 10: C = C Mod 10
txtb200 = Str(b200)
txtb100 = Str(b100)
txtb50 = Str(b50)
txtb20 = Str(b20)
txtb10 = Str(b10)
saldo = cant - Val(txtcantidad)

txtsaldo = saldo




Else
MsgBox "cantidad a retirar debe ser multiplo de 10"
txtcantidad = ""
txtcantidad.SetFocus
End If
End Sub

Private Sub cmdlimpiar_Click()
txtcantidad = ""
txtb200 = ""
txtb100 = ""
txtb50 = ""
txtb20 = ""
txtb10 = ""
txtcantidad.SetFocus
End Sub

Private Sub cmdsalir_Click()
End
End Sub

Private Sub Command2_Click()
Printer.Orientation = 1

Printer.FontSize = 12


Printer.Print
Printer.Print Tab(15); lblcantidad.Caption; Tab(30); txtcantidad.Text

Printer.EndDoc
Printer.Print


End Sub

Private Sub txtcantidad_Change()

End Sub

No hay comentarios: