Re: Moving a control with the mouse at runtime
- From: "Martin de Jong" <ML@xxxxxxxxxxxxxxxx>
- Date: Thu, 6 Oct 2005 15:07:32 +0200
i would try it with the buildin Drag And Drop functions...
user has to hold the mouse, but its a natural thing to do.
Martin de Jong
www.cbs.nl
"ian" <nospam@xxxxxxxxxx> schreef in bericht
news:%23yfktAnyFHA.2812@xxxxxxxxxxxxxxxxxxxxxxx
> 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 ***
.
- References:
- Prev by Date: Re: Moving a control with the mouse at runtime
- Next by Date: Re: Range().select using variables
- Previous by thread: Re: Moving a control with the mouse at runtime
- Next by thread: Re: Moving a control with the mouse at runtime
- Index(es):
Relevant Pages
|