Monday, February 14, 2011

Assignment 3 - Question One

When button is hovered over move button to a random location

 Public Class Form1
  
   Private Sub btn1_MouseHover(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn1.MouseHover
  
     Dim rnd1 As New Random
  
     Dim x As Integer = rnd1.Next(100)
  
     Dim y As Integer = rnd1.Next(100)
  
     btn1.Location = New Point(x, y)
  
   End Sub
  
 End Class  

No comments:

Post a Comment