This code defines event handlers for three controls on a form: Button1, LinkLabel1, and Button2. When Button1 is clicked, it generates a random number between 0 and 6, increments a loop counter, and displays a message box with the random value and loop count. When LinkLabel1 is clicked, it hides the current form and shows another form. When Button2 is clicked, it exits the application.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
29 views1 page
Public Class Form2
This code defines event handlers for three controls on a form: Button1, LinkLabel1, and Button2. When Button1 is clicked, it generates a random number between 0 and 6, increments a loop counter, and displays a message box with the random value and loop count. When LinkLabel1 is clicked, it hides the current form and shows another form. When Button2 is clicked, it exits the application.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1
Public Class Form2
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click Dim myValue As Integer Dim lop As Integer = 0 lop += 1 myvalue = CInt(Int((6 * Rnd()) + 0)) 'generate random value between 0 and 6 If myValue = TextBox1.Text Then End If MsgBox("value" & myValue & "looping ke" & lop) End Sub Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked Dim form2 As New Form Me.Hide() Form1.Show() End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Application.Exit() End Sub End Class