Mostrando entradas con la etiqueta PROGRAMACION. Mostrar todas las entradas
Mostrando entradas con la etiqueta PROGRAMACION. Mostrar todas las entradas

viernes, 12 de junio de 2015

EJEMPLO VISUAL BASIC

Ejemplo uso de condicionales:


Private Sub cmdVer_Click()
If Val(txtDinero.Text) > 10000 Then
frmCoche.Show
MsgBox "Cómprate un coche"
Else
frmMoto.Show
MsgBox "Cómprate una moto"
End If

End Sub

Para cerrar un panel secundario:

Private Sub cmdSalir_Click()
Unload Me
End Sub

Mas condicionales:


Private Sub cmdBorrar_Click()
txtBarra.Text = ""
End Sub

Private Sub hscDinero_Change()
txtBarra.Text = hscDinero.Value

If Val(txtBarra.Text) > 500 Then
txtResultado.Text = " ZONA CALIENTE "
txtResultado.BackColor = vbRed
txtResultado.ForeColor = vbBlack
txtResultado.Left = 5160
Else
txtResultado.Text = " ZONA FRIA"
txtResultado.BackColor = vbBlue
txtResultado.ForeColor = vbWhite
txtResultado.Left = 840
End If
End Sub