Exterinformática: Web del Maestro Carlos Coronado
  Ejercicio No. 7
 

Ejercicio Nº 7: DHTML: Operaciones
 
Ahora vamos a hacer una calculadora simple de operaciones matemáticas. Abrimos un nuevo proyecto DHTML y dibujamos una tabla con etiquetas y cajas de texto y cinco botones. En tiempo de ejecución se ve como la imagen de la izquierda. Y la codificación es la siguiente:

Private Sub Command1_Click()

Text3.Text = Val(Text1) + Val(Text2)
End Sub

Private Sub Command2_Click()

Text3.Text = Val(Text1) - Val(Text2)
End Sub

Private Sub Command3_Click()

Text3.Text = Val(Text1) / Val(Text2)
End Sub

Private Sub Command4_Click()

Text3.Text = Val(Text1) * Val(Text2)
End Sub
Private Sub Command5_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
End Sub

 
  Hoy habia 59 visitantes (70 clics a subpáginas) ¡Aqui en esta página!  
 
Este sitio web fue creado de forma gratuita con PaginaWebGratis.es. ¿Quieres también tu sitio web propio?
Registrarse gratis