Fun

Fun
Want to Play!

Friday, March 25, 2011

Button hover

 Public Class Form1
  
   Dim pt1 As New Point(100, 35)
  
   Dim pt2 As New Point(45, 500)
  
   Dim pt3 As New Point(354, 99)
  
   Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
  
     MessageBox.Show("You shot me", "Why would you shoot me?!?", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
  
   End Sub
  
   Private Sub Button1_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.MouseEnter
  
     If Button1.Location = pt1 Then
  
       Button1.Location = pt2
  
     ElseIf Button1.Location = pt2 Then
  
       Button1.Location = pt3
  
     ElseIf Button1.Location = pt3 Then
  
       Button1.Location = pt1
  
     End If
  
   End Sub
  
   Private Sub Button1_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.MouseHover
  
   End Sub
  
   Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  
     Button1.Location = pt1
  
   End Sub
  
 End Class
  

No comments:

Post a Comment