Home All Groups Group Topic Archive Search About
Author
23 Jul 2006 5:24 PM
rodchar
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

Author
24 Jul 2006 1:47 AM
iwdu15
yea...look at the textbox's mousedown and mousemove events.....but this is a
very curious question....can i ask the purpose of this?
--
-iwdu15
Author
24 Jul 2006 2:44 AM
rodchar
i want to make something like post it notes for personal use.

Show quoteHide quote
"iwdu15" wrote:

> yea...look at the textbox's mousedown and mousemove events.....but this is a
> very curious question....can i ask the purpose of this?
> --
> -iwdu15
Author
24 Jul 2006 2:56 AM
iwdu15
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

--
-iwdu15
Author
24 Jul 2006 12:37 PM
rodchar
thank you very much.

Show quoteHide quote
"iwdu15" wrote:

> 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
>
> --
> -iwdu15
Author
25 Jul 2006 12:03 AM
Dennis
Shouldn't that be:

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


--
Dennis in Houston


Show quoteHide quote
"iwdu15" wrote:

> 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
>
> --
> -iwdu15
Author
25 Jul 2006 12:04 AM
Dennis
Sorry, that is:

Me.left = Me.Left + ptOld.X - e.x
Me.Top = Me.Top + ptOld.Y - e.Y
--
Dennis in Houston


Show quoteHide quote
"iwdu15" wrote:

> 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
>
> --
> -iwdu15
Author
25 Jul 2006 6:15 AM
Cor Ligthert [MVP]
Rodchar

Maybe a little bit late after that Iwdu15 has given you the correct answer,
but I should have given you this link for your problem.

I like forever to give this one.
http://www.vb-tips.com/dbpages.aspx?ID=72f58d3f-2cb5-4d51-b148-a2eda88e06ee

Cor

Show quoteHide quote
"rodchar" <rodc***@discussions.microsoft.com> schreef in bericht
news:2FE2AD84-B552-417C-AE3C-A2B62356D727@microsoft.com...
> 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