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.
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% 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.
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