martes, 25 de noviembre de 2008

visual basic calculadora


Private Sub Command5_Click()End SubPrivate Sub Command4_Click()End SubPrivate Sub borrar_Click()numeros.Caption = ""End SubPrivate Sub Command1_Click()End SubPrivate Sub dividir_Click()aux1.Caption = numeros.Captionaux2.Caption = "/"numeros.Caption = ""End SubPrivate Sub igual_Click()If aux2.Caption = "+" Thennumeros.Caption = Val(aux1.Caption) + Val(numeros.Caption)aux1.Caption = ""aux2.Caption = ""End IfIf aux2.Caption = "-" Thennumeros.Caption = Val(aux1.Caption) - Val(numeros.Caption)aux1.Caption = ""aux2.Caption = ""End IfIf aux2.Caption = "*" Thennumeros.Caption = Val(aux1.Caption) * Val(numeros.Caption)aux1.Caption = ""aux2.Caption = ""End IfIf aux2.Caption = "/" Thennumeros.Caption = Val(aux1.Caption) / Val(numeros.Caption)aux1.Caption = ""aux2.Caption = ""End IfEnd SubPrivate Sub mas_Click()aux1.Caption = numeros.Captionaux2.Caption = "+"numeros.Caption = ""End SubPrivate Sub menos_Click()aux1.Caption = numeros.Captionaux2.Caption = "-"numeros.Caption = ""End SubPrivate Sub multiplicar_Click()aux1.Caption = numeros.Captionaux2.Caption = "*"numeros.Caption = ""End SubPrivate Sub n0_Click()numeros.Caption = numeros.Caption + "0"End SubPrivate Sub n1_Click()numeros.Caption = numeros.Caption + "1"End SubPrivate Sub n2_Click()numeros.Caption = numeros.Caption + "2"End SubPrivate Sub n3_Click()numeros.Caption = numeros.Caption + "3"End SubPrivate Sub n4_Click()numeros.Caption = numeros.Caption + "4"End SubPrivate Sub n5_Click()numeros.Caption = numeros.Caption + "5"End SubPrivate Sub n6_Click()numeros.Caption = numeros.Caption + "6"End SubPrivate Sub n7_Click()numeros.Caption = numeros.Caption + "7"End SubPrivate Sub n8_Click()numeros.Caption = numeros.Caption + "8"End SubPrivate Sub n9_Click()numeros.Caption = numeros.Caption + "9"End SubPrivate Sub punto_Click()numeros.Caption = numeros.Caption + "."End Sub

No hay comentarios: