Os dejo el source de esta calculadora estilo windows.
Aun no se porque tiene bug el boton de coma...
Esta bastante simplificada... ya que no conozco aun demasiadas funciones xD
Código
Dim asuma, aresta, amulti, adivi Dim result As Boolean Private Sub Command11_Click() 'Tecla + Text1.Text = asuma + Val(Text1.Text) asuma = Val(Text1.Text) & d 'el caracter sirve para que diferencie entre el 0 'de valor de la variable por defecto y el 0 metido por el usuario result = True End Sub Private Sub Command13_Click() 'Tecla - If Not aresta = 0 Then Text1.Text = aresta - Val(Text1.Text) End If aresta = Val(Text1.Text) & d 'el caracter sirve para que diferencie entre el 0 'de valor de la variable por defecto y el 0 metido por el usuario result = True End Sub Private Sub Command14_Click() 'Tecla * If Not amulti = 0 Then Text1.Text = amulti * Val(Text1.Text) End If amulti = Val(Text1.Text) & d 'el caracter sirve para que diferencie entre el 0 'de valor de la variable por defecto y el 0 metido por el usuario result = True End Sub Private Sub Command15_Click() 'Tecla / If Not adivi = 0 Then Text1.Text = adivi / Val(Text1.Text) End If adivi = Val(Text1.Text) & d 'el caracter sirve para que diferencie entre el 0 'de valor de la variable por defecto y el 0 metido por el usuario result = True End Sub Private Sub Command12_Click() 'Tecla = If Not asuma = 0 Then Text1.Text = Val(Text1.Text) + asuma End If If Not aresta = 0 Then Text1.Text = aresta - Val(Text1.Text) End If If Not amulti = 0 Then Text1.Text = Val(Text1.Text) * amulti End If If Not adivi = 0 Then Text1.Text = adivi / Val(Text1.Text) End If asuma = 0 aresta = 0 amulti = 0 adivi = 0 result = True End Sub Private Sub Command1_Click() 'Tecla 7 If Not Text1.Text = 0 And result = False Then Text1.Text = Text1.Text & 7 Else Text1.Text = 7 result = False End If End Sub Private Sub Command10_Click() 'Tecla 0 If Not Text1.Text = 0 And result = False Then Text1.Text = Text1.Text & 0 Else Text1.Text = 0 result = False End If End Sub Private Sub Command2_Click() 'Tecla 8 If Not Text1.Text = 0 And result = False Then Text1.Text = Text1.Text & 8 Else Text1.Text = 8 result = False End If End Sub Private Sub Command3_Click() 'Tecla 9 If Not Text1.Text = 0 And result = False Then Text1.Text = Text1.Text & 9 Else Text1.Text = 9 result = False End If End Sub Private Sub Command4_Click() 'Tecla 4 If Not Text1.Text = 0 And result = False Then Text1.Text = Text1.Text & 4 Else Text1.Text = 4 result = False End If End Sub Private Sub Command5_Click() 'Tecla 5 If Not Text1.Text = 0 And result = False Then Text1.Text = Text1.Text & 5 Else Text1.Text = 5 result = False End If End Sub Private Sub Command6_Click() 'Tecla 6 If Not Text1.Text = 0 And result = False Then Text1.Text = Text1.Text & 6 Else Text1.Text = 6 result = False End If End Sub Private Sub Command7_Click() 'Tecla 3 If Not Text1.Text = 0 And result = False Then Text1.Text = Text1.Text & 3 Else Text1.Text = 3 result = False End If End Sub Private Sub Command8_Click() 'Tecla 2 If Not Text1.Text = 0 And result = False Then Text1.Text = Text1.Text & 2 Else Text1.Text = 2 result = False End If End Sub Private Sub Command9_Click() 'Tecla 1 If Not Text1.Text = 0 And result = False Then Text1.Text = Text1.Text & 1 Else Text1.Text = 1 result = False End If End Sub Private Sub Command16_Click() 'Esto aun no funciona bien, no distingue 'entre 0 y 0. y la funcion val() hecha abajo todas las comas (¿?) 'Tecla , (No funciona) If Not Text1.Text = 0 And result = False Then Text1.Text = Text1.Text & "." Else Text1.Text = "0." result = False End If End Sub Private Sub Command17_Click() 'Tecla de borrado Text1.Text = 0 asuma = 0 aresta = 0 amulti = 0 adivi = 0 result = False End Sub Private Sub Form_Load() result = False End Sub
Un saludo ^^ a ver si la podemos mejorar xD
Edit: Aqui esta el ejecutable y el form
http://www.megaupload.com/?d=TMQM6QBP