moving the form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hey all,
is there a way to have it where if a user clicks and holds down left mouse
button on a TextBox they will be able to move the form around the desktop?

thanks,
rodchar
 
yea...look at the textbox's mousedown and mousemove events.....but this is a
very curious question....can i ask the purpose of this?
 
ok, so its something like this

''GLobal Var
Private ptOld as Point

Private boolDown as Boolean = False

Private Sub txtStuff_MouseDown(..)

If e.Button = MouseButtons.Left then

ptOld.X = e.x
ptOld.Y = e.y

boolDown = true

end if

end sub


Private SUb txtStuff_MouseMove(.,..)

if boolDown then

Me.left = ptOld.X - e.x
Me.Top = ptOld.Y - e.Y

end if

end sub


Private Sub txtStuff_MouseUp(...)

boolDown = false

end sub



something along those lines

hope this helps
 
Shouldn't that be:

Me.left = Me.left + ptOld.X - e.x
Me.Top = Me.Left + ptOld.Y - e.Y
Me.Refresh
 
Back
Top