Thread: VB prank help.
View Single Post
Old 10-17-2006, 09:49 PM   #2 (permalink)
Kallian
CHARLIE DON'T SURF!
 
Kallian's Avatar
 
Join Date: Jul 2004
Posts: 778
+0 Internets
HTML Code:
Dim myRandom As New Random Private Sub Button1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button1.MouseMove Button1.Left = myRandom.Next(Button1.Width, Me.Width - Button1.Width) Button1.Top = myRandom.Next(Button1.Height, Me.Height - Button1.Height) End Sub
MouseMove works better than MouseEnter.

Oh, and for the Tab issue, set the button's TabStop property to False.

Also, I have realized that it can go behind controls that are larger than it. Just right click on the button and click, "Bring To Front", after you are done adding controls.

Last edited by Kallian : 10-17-2006 at 10:04 PM.
Kallian is offline   Reply With Quote

 
Uberguilds Network