By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,224 Members | 1,201 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,224 IT Pros & Developers. It's quick & easy.

mouse move event doesn't change Y position

P: n/a
I'm trying to build a controls editor, that given a control (textbox)
somewhere
on a form, it can be moved using the mouse to drag-drop

I have a simple form with a square text box (1" x 1") and 2 info text
boxes (txtX and txtY)

the square text box has this mouse move event
Dim p As POINTAPI

GetCursorPos p
txtX = p.X
txtY = p.Y

using this api
Type POINTAPI
X As Integer
Y As Integer
End Type

Declare Sub GetCursorPos Lib "User32" (lpPoint As POINTAPI)

if I have the focus on the txtX box,
as I move the mouse within the square text box, txtX changes as
expected, but txtY is always 0

if I have the focus on square text box, same thing happens
I tried using a label and a command control... same result

any idea why Y is always 0 ?

ps. using access97
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
I was able to get it to work by changing how X and Y were decalred. The
documentation that I have requires X and Y to be delared as Long, not
integer.

Mike Storr
www.veraccess.com

"Roger" <le*********@natpro.com> wrote in message
news:8c**************************@posting.google.c om...
I'm trying to build a controls editor, that given a control (textbox)
somewhere
on a form, it can be moved using the mouse to drag-drop
any idea why Y is always 0 ?

ps. using access97

Nov 12 '05 #2

P: n/a
thanks.. I got the code from microsoft.com, but it must have been
16-bit thus the 'integer' definition

"Mike Storr" <st******@sympatico.ca> wrote in message news:<ZO*******************@news20.bellglobal.com> ...
I was able to get it to work by changing how X and Y were decalred. The
documentation that I have requires X and Y to be delared as Long, not
integer.

Mike Storr
www.veraccess.com

"Roger" <le*********@natpro.com> wrote in message
news:8c**************************@posting.google.c om...
I'm trying to build a controls editor, that given a control (textbox)
somewhere
on a form, it can be moved using the mouse to drag-drop

any idea why Y is always 0 ?

ps. using access97

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.