Moving a control with the mouse at runtime
- From: ian <nospam@xxxxxxxxxx>
- Date: Thu, 06 Oct 2005 05:19:18 -0700
I assumed this would be a really easy challenge, but VB6 doesn't seem to
want to play.
Very simply I tried the following:
on mousedown event capture existing x and y
on mousemove event calculate the delta and move the control this
distance and store the new x and y
This simply doesn't work.
First, moving a control under a stationary mouse generates a mouse moved
event! (I checked this with a control on the form moved using a timer.
Place the cursor over it and watch movemove events appear)
Second something is wrong in the world of twips, or the reported twips
returned by the mousemove event. The mouse pointer gets further and
further from the control being dragged.
I'm thinking perhaps using the win32api to get the exact mouse cursor
position, but I imagine that will have problems translating to an in
container position.
Any help would be appreciated.
*** Sent via Developersdex http://www.developersdex.com ***
.
- Follow-Ups:
- Re: Moving a control with the mouse at runtime
- From: Larry Serflaten
- Re: Moving a control with the mouse at runtime
- From: Martin de Jong
- Re: Moving a control with the mouse at runtime
- From: Norm Cook
- Re: Moving a control with the mouse at runtime
- Prev by Date: format number
- Next by Date: Re: format number
- Previous by thread: format number
- Next by thread: Re: Moving a control with the mouse at runtime
- Index(es):
Relevant Pages
|