Quote:
|
Originally Posted by Kallian 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. |
Thank you. Though I don't think vb 6.0 (what .net2k3 uses) has seperate move/enter on mouse. I think they combined it into mousehover. I'll play around with it and see. Thank you. =)
EDIT: Also, does the variable need to be a class level variable? Going to be putting it in a program I'm going to be turning into her (extra credit for that kinda thing, she finds it hilarious. button1.visible=false was an amusing one. =P), but anyway, yeah, Does it matter if its class-level or control-level? Just curious, want to hide it the best I can.
EDIT: Yeah, mousemove is still there.