hacker


Ingresar con nombre de usuario, contraseña y duración de la sesión
| Portal Hacker | Editorial | Descargas | Ezine |
Inicio Ayuda Ingresar Registrarse
15 de Octubre de 2008, 08:57:02
Noticias: Nomina a tus preferidos para los pOrtal Hacker Awards 2008
Para ver este enlace Registrate o Inicia Sesion
aqui

+  Foros pOrtal Hacker
|-+  Programacion
| |-+  Programación en general
| | |-+  Visual Basic (Moderadores: ranefi, crypto136, ziBboh, >> s E t H <<)
| | | |-+  como hacer una calculadora en visual basic
0 Usuarios y 1 Visitante están viendo este tema. « anterior próximo »
Páginas: [1] Ir Abajo Imprimir
Autor Tema: como hacer una calculadora en visual basic  (Leído 9854 veces)
gundam69
Recien llegado
*
Desconectado Desconectado

Mensajes: 7

Member, pOrtal HAcker


Ver Perfil
« : 03 de Julio de 2006, 09:32:00 »

necesito hacer una calculadora en visual para un proyecto, pero no tengo ni idea de como hacerla, es una supuesta investigacion de programacion, si alguien pudiera decirme o explicarme gracias de antemano Smiley Smiley Wink Cheesy
En línea
ranefi
Moderador Global
*****
Desconectado Desconectado

Mensajes: 1,191


SELECT * FROM guapos WHERE papito_chulo = 'ranefi'


Ver Perfil WWW
« Respuesta #1 : 05 de Julio de 2006, 06:35:46 »

necesito hacer una calculadora en visual para un proyecto, pero no tengo ni idea de como hacerla, es una supuesta investigacion de programacion, si alguien pudiera decirme o explicarme gracias de antemano Smiley Smiley Wink Cheesy

Buen día gundam69. Aquí te dejo un ejemplo que espero te sirva.

------->
Para ver este enlace Registrate o Inicia Sesion
DESCARGAR
<-------

Nos vemos.
En línea


SELECT * FROM mejores_batos_ del_mundo WHERE id = (SELECT DISTINCT id_guapo FROM los_mas_guapos _del_mundo WHERE papito_chulo = 'ranefi')
trader
NZ1
*
Desconectado Desconectado

Mensajes: 37

Member, pOrtal HAcker


Ver Perfil
« Respuesta #2 : 22 de Julio de 2006, 08:57:30 »

Hola bueno hace 3 cajas de text y un boton command: y coloca este codigo

'Lo que hace este codigo suma lo que pusiste en la primera caja y lo de la segunda y
te muestra el resultado en la tercer caja de texto

'Solamente si quieres que haga otra cosa cambia el operador logico

'este codigo tenes que meterlo adentro del botton command



Private sub command1_Click()
text3.text = (val)text1.text +(val) Text 2.text
end sub
En línea
FoMoIrEoMX
NZ1
*
Desconectado Desconectado

Mensajes: 54


EL AZAR FAVORECE A UNA MENTE PREPARADA


Ver Perfil
« Respuesta #3 : 25 de Julio de 2006, 08:59:07 »

Aqui tienes el codigo de una calculadora que hice, solo copia el codigo tal y como esta y listo, no importa que uses decimales

Dim a As Boolean
Dim tipo As String
Dim can1 As String
Dim can2 As String
Dim signo As String

Private Sub Command1_Click()
If Text1.Text = "0" Then Text1.Text = ""
If a = True Then
Text1.Text = "1"
a = False
Else
Text1.Text = Text1.Text & "1"
End If
End Sub

Private Sub Command11_Clic k()
If a = True Then
Text1.Text = "0"
a = False
Else
Text1.Text = Text1.Text & "0"
End If
End Sub

Private Sub Command12_Clic k()
If a = True Then
Text1.Text = "00"
a = False
Else
Text1.Text = Text1.Text & "00"
End If
End Sub

Private Sub Command13_Clic k()
If tipo = "suma" Then
can2 = Text1.Text
Text1.Text = CDbl(can1) + CDbl(can2)
can1 = Text1.Text
a = True
tipo = "suma"
ElseIf tipo = "resta" Then
can2 = Text1.Text
Text1.Text = CDbl(can1) - CDbl(can2)
can1 = Text1.Text
a = True
tipo = "suma"
ElseIf tipo = "multi" Then
can2 = Text1.Text
Text1.Text = CDbl(can1) * CDbl(can2)
can1 = Text1.Text
a = True
tipo = "suma"
ElseIf tipo = "divi" Then
can2 = Text1.Text
Text1.Text = CDbl(can1) / CDbl(can2)
can1 = Text1.Text
a = True
tipo = "suma"
ElseIf tipo = "" Then
can1 = Text1.Text
a = True
tipo = "suma"
End If
End Sub

Private Sub Command14_Clic k()
If tipo = "suma" Then
can2 = Text1.Text
Text1.Text = CDbl(can1) + CDbl(can2)
can1 = Text1.Text
a = True
tipo = "resta"
ElseIf tipo = "resta" Then
can2 = Text1.Text
Text1.Text = CDbl(can1) - CDbl(can2)
can1 = Text1.Text
a = True
tipo = "resta"
ElseIf tipo = "multi" Then
can2 = Text1.Text
Text1.Text = CDbl(can1) * CDbl(can2)
can1 = Text1.Text
a = True
tipo = "resta"
ElseIf tipo = "divi" Then
can2 = Text1.Text
Text1.Text = CDbl(can1) / CDbl(can2)
can1 = Text1.Text
a = True
tipo = "resta"
ElseIf tipo = "" Then
can1 = Text1.Text
a = True
tipo = "resta"
End If
End Sub

Private Sub Command15_Clic k()
If tipo = "suma" Then
can2 = Text1.Text
Text1.Text = CDbl(can1) + CDbl(can2)
can1 = Text1.Text
a = True
tipo = "multi"
ElseIf tipo = "resta" Then
can2 = Text1.Text
Text1.Text = CDbl(can1) - CDbl(can2)
can1 = Text1.Text
a = True
tipo = "multi"
ElseIf tipo = "multi" Then
can2 = Text1.Text
Text1.Text = CDbl(can1) * CDbl(can2)
can1 = Text1.Text
a = True
tipo = "multi"
ElseIf tipo = "divi" Then
can2 = Text1.Text
Text1.Text = CDbl(can1) / CDbl(can2)
can1 = Text1.Text
a = True
tipo = "multi"
ElseIf tipo = "" Then
can1 = Text1.Text
a = True
tipo = "multi"
End If
End Sub

Private Sub Command16_Clic k()
If tipo = "suma" Then
can2 = Text1.Text
Text1.Text = CDbl(can1) + CDbl(can2)
can1 = Text1.Text
a = True
tipo = "divi"
ElseIf tipo = "resta" Then
can2 = Text1.Text
Text1.Text = CDbl(can1) - CDbl(can2)
can1 = Text1.Text
a = True
tipo = "divi"
ElseIf tipo = "multi" Then
can2 = Text1.Text
Text1.Text = CDbl(can1) * CDbl(can2)
can1 = Text1.Text
a = True
tipo = "divi"
ElseIf tipo = "divi" Then
can2 = Text1.Text
Text1.Text = CDbl(can1) / CDbl(can2)
can1 = Text1.Text
a = True
tipo = "divi"
ElseIf tipo = "" Then
can1 = Text1.Text
a = True
tipo = "divi"
End If
End Sub

Private Sub Command17_Clic k()
If tipo = "suma" Then
can2 = Text1.Text
Text1.Text = CDbl(can1) + CDbl(can2)
can1 = Text1.Text
a = True
tipo = ""
ElseIf tipo = "resta" Then
can2 = Text1.Text
Text1.Text = CDbl(can1) - CDbl(can2)
can1 = Text1.Text
a = True
tipo = ""
ElseIf tipo = "multi" Then
can2 = Text1.Text
Text1.Text = CDbl(can1) * CDbl(can2)
can1 = Text1.Text
a = True
tipo = ""
ElseIf tipo = "divi" Then
can2 = Text1.Text
Text1.Text = CDbl(can1) / CDbl(can2)
can1 = Text1.Text
a = True
tipo = ""
ElseIf tipo = "" Then
can1 = Text1.Text
a = True
tipo = ""
End If
End Sub

Private Sub Command18_Clic k()
a = False
Text1.Text = ""
can1 = "0"
can2 = "0"
Command1.Enabl ed = False
Command2.Enabl ed = False
Command3.Enabl ed = False
Command4.Enabl ed = False
Command5.Enabl ed = False
Command6.Enabl ed = False
Command7.Enabl ed = False
Command8.Enabl ed = False
Command9.Enabl ed = False
Command11.Enab led = False
Command12.Enab led = False
Command13.Enab led = False
Command14.Enab led = False
Command15.Enab led = False
Command16.Enab led = False
Command17.Enab led = False
Command19.Enab led = False
Command20.Enab led = True
Command18.Enab led = False
Command10.Enab led = False
Command22.Enab led = False
Command21.Enab led = False
Command23.Enab led = False
End Sub

Private Sub Command19_Clic k()
a = False
Text1.Text = "0"
can1 = "0"
can2 = "0"
End Sub

Private Sub Command2_Click()
If Text1.Text = "0" Then Text1.Text = ""
If a = True Then
Text1.Text = "2"
a = False
Else
Text1.Text = Text1.Text & "2"
End If
End Sub

Private Sub Command20_Clic k()
Text1.Text = "0"
a = False
can1 = "0"
can2 = "0"
Command1.Enabl ed = True
Command2.Enabl ed = True
Command3.Enabl ed = True
Command4.Enabl ed = True
Command5.Enabl ed = True
Command6.Enabl ed = True
Command7.Enabl ed = True
Command8.Enabl ed = True
Command9.Enabl ed = True
Command11.Enab led = True
Command12.Enab led = True
Command13.Enab led = True
Command14.Enab led = True
Command15.Enab led = True
Command16.Enab led = True
Command17.Enab led = True
Command19.Enab led = True
Command20.Enab led = False
Command18.Enab led = True
Command10.Enab led = True
Command22.Enab led = True
Command21.Enab led = True
Command23.Enab led = True
End Sub

Private Sub Command21_Clic k()
If Left(Text1.Text, 1) = "-" Then
signo = Mid(Text1.Text, 2)
Text1.Text = signo
Else
Text1.Text = "-" & Text1.Text
End If
End Sub

Private Sub Command22_Clic k()
Text1.Text = "0"
End Sub

Private Sub Command23_Clic k()
If a = True Then
Text1.Text = ","
a = False
Else
Text1.Text = Text1.Text & ","
End If
End Sub

Private Sub Command3_Click()
If Text1.Text = "0" Then Text1.Text = ""
If a = True Then
Text1.Text = "3"
a = False
Else
Text1.Text = Text1.Text & "3"
End If
End Sub

Private Sub Command4_Click()
If Text1.Text = "0" Then Text1.Text = ""
If a = True Then
Text1.Text = "4"
a = False
Else
Text1.Text = Text1.Text & "4"
End If
End Sub

Private Sub Command5_Click()
If Text1.Text = "0" Then Text1.Text = ""
If a = True Then
Text1.Text = "5"
a = False
Else
Text1.Text = Text1.Text & "5"
End If
End Sub

Private Sub Command6_Click()
If Text1.Text = "0" Then Text1.Text = ""
If a = True Then
Text1.Text = "6"
a = False
Else
Text1.Text = Text1.Text & "6"
End If
End Sub

Private Sub Command7_Click()
If Text1.Text = "0" Then Text1.Text = ""
If a = True Then
Text1.Text = "7"
a = False
Else
Text1.Text = Text1.Text & "7"
End If
End Sub

Private Sub Command8_Click()
If Text1.Text = "0" Then Text1.Text = ""
If a = True Then
Text1.Text = "8"
a = False
Else
Text1.Text = Text1.Text & "8"
End If
End Sub

Private Sub Command9_Click()
If Text1.Text = "0" Then Text1.Text = ""
If a = True Then
Text1.Text = "9"
a = False
Else
Text1.Text = Text1.Text & "9"
End If
End Sub

Private Sub Form_Load()
a = False
can1 = "0"
can2 = "0"
Command1.Enabl ed = False
Command2.Enabl ed = False
Command3.Enabl ed = False
Command4.Enabl ed = False
Command5.Enabl ed = False
Command6.Enabl ed = False
Command7.Enabl ed = False
Command8.Enabl ed = False
Command9.Enabl ed = False
Command11.Enab led = False
Command12.Enab led = False
Command13.Enab led = False
Command14.Enab led = False
Command15.Enab led = False
Command16.Enab led = False
Command17.Enab led = False
Command19.Enab led = False
End Sub
______________ ______________ ______________ _______
Command1 = numero 1
Command2 = numero 2
Command3 = numero 3
Command4 = numero 4
Command5 = numero 5
Bueno creo que ya se va entendiendo, hasta el numero 9 ....
Command9 = numero 9
Si se preguntan por el 10, no esta
Command11 = numero 0
Command12 = numero 00
Command13 = signo + osea suma
Command14 = signo – osea resta
Command15 = signo X multiplicacion
Command16 = signo / divicion
Command17 = signo = resultado
Command18 = off apagado
Command19 = AC Borra la cantidad y cancela los eventos, suma, resta,etc.
Command20 = ON encendido
Command21 = +/- cambiar signo
Command22 = CE  borrar la cantidad marcada en la pantalla sin cancelar el evento, suma, resta, etc.
Command23 = punto .
Textbox1= locked = true, alignment = 1
En línea
Páginas: [1] Ir Arriba Imprimir 
« anterior próximo »
Ir a:  


Ingresar con nombre de usuario, contraseña y duración de la sesión

Powered by SMF 1.1.6 | SMF © 2006-2008, Simple Machines LLC hacker

Juegos gratis - Articulos PHP - Juegos - Trucos - Letras - Juegos - Juegos Online