Académique Documents
Professionnel Documents
Culture Documents
Tabla de contenido
2. 4. Ejemplo 2 sumas ...................................................................................................... 6 Ejercicio 4Temperatura .......................................................................................... 10
1. Ejemplo 1Colores
Es una aplicacin que nos permite cambiar el color o posicion del Label fcilmente con solo seleccionar el color y el lugar al q se quiere desplazar
End Sub
End Sub
End Sub
End Sub
2. Ejemplo 2 sumas Es una aplicacin que nos sirve para hacer sumas de dos o ms nmeros la cual esta basada en una programacin fcil y de fcil utilizacin la cual se opera con botones de fcil utilizacin
Private Sub Command1_Click() Text1.Text = "" Text2.Text = "" Text3.Text = "" End Sub
Private Sub Command2_Click() Dim suma As Integer suma = Val(Text1.Text) + Val(Text2.Text) + Val(Text3.Text) Text4.Text = suma End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then If Text1.Text = "" Then MsgBox ("digite el valor correspondiente") Text1.SetFocus Else Text2.SetFocus End If End If End Sub Private Sub Text2_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then If Text2.Text = "" Then MsgBox ("digite el valor correspondiente") Text2.SetFocus Else Text3.SetFocus End If End If End Sub Private Sub Text3_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then If Text3.Text = "" Then MsgBox ("digite el valor correspondiente") Text3.SetFocus Else
Command2.SetFocus End If End If End Sub 3. Ejercicio 3Calculadora Es una aplicacin que tiene el mismo funcionamiento de una calculadora ya que hace las cuatro operaciones matemticas.
End Sub
End Sub
End Sub
Private Sub cmdDiv_Click() txtResult.Text = Val(home.Text) / Val(txtOper2.Text) lblOp.Caption = "/" End Sub
Private Sub cmdProd_Click() txtResult.Text = Val(home.Text) * Val(txtOper2.Text) lblOp.Caption = "*" End Sub
Private Sub cmdResta_Click() txtResult.Text = Val(home.Text) - Val(txtOper2.Text) lblOp.Caption = "-" End Sub
Private Sub cmdSuma_Click() txtResult.Text = Val(home.Text) + Val(txtOper2.Text) lblOp.Caption = "+" End Sub
End Sub
End Sub
End Sub
4. Ejercicio 4Temperatura
Esta aplicacin nos muestra en el Label la conversin de la temperatura de grados centgrados a grados Fahrenheit.
Private Sub cmbSalir_Click() Beep End End Sub Private Sub mnuFileExit_Click() End End Sub Private Sub vsbTemp_Change() TxtCent.Text = vsbTemp.Value txtFahr.Text = 32 + 1.8 * vsbTemp.Value
10
End Sub
11