0% found this document useful (0 votes)
38 views

Primero

The document contains code for two classes - Primero and Random. The Primero class handles a text box and button click event. It checks if the text box contains a password and shows/hides a label accordingly. The Random class generates random numbers for three labels on button click. It shows/hides a picture box depending on the values generated. On form load, it hides the picture box. It also contains an exit button.

Uploaded by

wabo_23
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

Primero

The document contains code for two classes - Primero and Random. The Primero class handles a text box and button click event. It checks if the text box contains a password and shows/hides a label accordingly. The Random class generates random numbers for three labels on button click. It shows/hides a picture box depending on the values generated. On form load, it hides the picture box. It also contains an exit button.

Uploaded by

wabo_23
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Primero

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e


As System.EventArgs) Handles TextBox1.TextChanged

End Sub

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


System.EventArgs) Handles Button1.Click
Dim a As Integer

If TextBox1.Text = "soytupadre" Then


Label2.Show()
Else
a = MsgBox("Clave incorrecta, intenta de nuevo")

End If
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
Label2.Hide()

End Sub
End Class

Random
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Label1.Click

End Sub

Private Sub Label2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Label2.Click

End Sub

Private Sub Label3_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Label3.Click
Randomize()
Dim generar As Integer = CInt(Int((6 * Rnd()) + 1))
Label1.Text = generar
End Sub

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


System.EventArgs) Handles Button1.Click
Randomize()
Dim generar As Integer = CInt(Int((9 * Rnd()) + 1))
Label1.Text = generar
Randomize()
Dim generar1 As Integer = CInt(Int((9 * Rnd()) + 1))
Label2.Text = generar1
Randomize()
Dim generar2 As Integer = CInt(Int((9 * Rnd()) + 1))
Label3.Text = generar2
If generar = 7 Then
PictureBox1.Show()
Else
PictureBox1.Hide()
End If
If generar1 = 7 Then
PictureBox1.Show()
Else
PictureBox1.Hide()
If generar2 = 7 Then
PictureBox1.Show()
Else
PictureBox1.Hide()
End If
End If

End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load
PictureBox1.Hide()

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
End
End Sub
End Class

You might also like