Tahap awal dalam Pembuatan program ini adalah membuat form dan berikan komponen:
- 1 Timer
- 1 Picturebox
Public Class Form1
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
PictureBox1.Left = MousePosition.X
PictureBox1.Top = MousePosition.Y - 20
If PictureBox1.Left = Me.Right Then
PictureBox1.Left -= 10
ElseIf PictureBox1.Top > Me.Bottom Then
PictureBox1.Top += 10
End If
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Enabled = True
Me.WindowState = FormWindowState.Maximized
End Sub
End Class
0 comments:
Speak up your mind
Tell us what you're thinking... !