Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Form1 you need:
- -4 buttons
- -1 label
- -1 timer
- -Form1 must be 923x580
- Form2 you need:
- -1 button
- -----------------------------------------------------------------------------------------------------------------------------------
- Public Class Form1
- Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
- Label1.Text = Format(Now, "yyyy-MM-dd hh:mm:ss")
- End Sub
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- Timer1.Start()
- Label1.Location = New Point(174, 21)
- End Sub
- Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
- Timer1.Stop()
- Label1.Text = "Click a button"
- Label1.Location = New Point(264, 22)
- End Sub
- Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
- Dim oForm As Form2
- oForm = New Form2()
- oForm.Show()
- oForm = Nothing
- End Sub
- Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
- Application.Exit()
- End Sub
- End Class
- -----------------------------------------------------------------------------------------------------------------------------------
- Public Class Form2
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- Me.Close()
- End Sub
- Private Sub Button1_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.MouseEnter
- Button1.Text = "Are you sure you want to exit?"
- End Sub
- Private Sub Button1_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.MouseLeave
- Button1.Text = "Close this window"
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement