You are on page 1of 4

TIMER

Public Class Form1



Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer1.Tick
Label1.Text = Label1.Text + 1
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Label1.Text = 0
Timer1.Enabled = True

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
Timer1.Enabled = False



End Sub

Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer2.Tick
If Label1.Text = 10 Then

Timer2.Enabled = False
Timer1.Enabled = False
MessageBox.Show(" Vamos a Morir")
End If

End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

End Sub
End Class

Clave
Public Class Form1

Private Sub BTNIngresar_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BTNIngresar.Click
If TxtUserName.Text = "admin" Then
If TxtPassword.Text = "inacap" Then
'muestra el formulario llamado calculo
Calculo.Show()
'oculta este formulario
Me.Hide()
Else
'muestra cuadro de mensaje
MsgBox("error clave", MsgBoxStyle.Critical, "Error de Ingreso")
'limpia el textbox
TxtPassword.Text = ""
'pasa el cursor al textbox
TxtPassword.Focus()

End If
Else
MsgBox("error usuario", MsgBoxStyle.Critical, "Error de Ingreso")
TxtUserName.Text = ""
TxtUserName.Focus()
End If

End Sub




Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

End Sub
End Class


SELECT CASE
Public Class FrmSelect
Dim opcion As String
Dim pais As String
Private Sub FrmSelect_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

End Sub

Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles RadioButton1.CheckedChanged
opcion = "opcion1"
End Sub

Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles RadioButton2.CheckedChanged
opcion = "opcion2"
End Sub

Private Sub RadioButton3_CheckedChanged(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles RadioButton3.CheckedChanged
opcion = "opcion3"
End Sub

Private Sub BTNElegir_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BTNElegir.Click
Select Case opcion
Case "opcion1"
MsgBox("Usted elegio la opcion uno", MsgBoxStyle.Information,
"Mensaje")

Case "opcion2"
MsgBox("Usted elegio la opcion dos", MsgBoxStyle.Information,
"Mensaje")

Case "opcion3"
MsgBox("Usted elegio la opcion Tres", MsgBoxStyle.Information,
"Mensaje")

End Select

End Sub

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
pais = ComboBox1.Text
Select Case pais
Case "Chile"
MsgBox("Usted elegio Chile", MsgBoxStyle.Exclamation, "Mensaje")

Case "Peru"
MsgBox("Usted elegio Peru", MsgBoxStyle.Exclamation, "Mensaje")

Case "Brasil"
MsgBox("Usted elegio la opcion Brasil", MsgBoxStyle.Exclamation,
"Mensaje")

End Select
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)

End Sub

Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
'If Len(TextBox1.Text) = "" Then
' MsgBox("debe ingresar un numero")
' TextBox1.Text = ""
' TextBox1.Focus()
'End If
If TextBox1.Text = "" Then
MsgBox("debe ingresar un numero")
TextBox1.Text = ""
TextBox1.Focus()
End If
End Sub

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If Not IsNumeric(e.KeyChar) Then e.Handled = True

End Sub


End Class