473,320 Members | 1,572 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

mouse move event doesn't change Y position

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
2 2400
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Carlos García-Carazo | last post by:
Hello, I am working on a C# application for an industrial machine, using Windows Forms, where the user could look at the screen from a 90 degree rotated position, like he could turn the monitor...
3
by: jcrouse | last post by:
I have created a form designer type application (with a lot of you peoples helpJ). It has label controls that are draggable at runtime. The user is also allowed to change some properties such as...
16
by: Niels Jensen | last post by:
I have been developing a little project which draw's a hexgrid on a panel within a form similar to this - it:s used as a client from a e-mail based strategy game: ____ ____ / \...
3
by: Tom | last post by:
I have a picturebox on my VB.NET form. The picturebox size mode is set to stretched. I then load an image into that form and display it. As the user moves the mouse over the form, I want to get and...
19
by: wmanzo | last post by:
I have a really professional conspiracy movie site and I use tons of layers and an external scroll bar assembly. I would like to put the various sections into MS Iframes and in order to clean up...
3
by: wanwan | last post by:
I made a game with a window form that needs to record the mouse position to an array at 100 samples per second, so I use the mouse move event to do the job. The problem is the mouse move event...
0
Ali Rizwan
by: Ali Rizwan | last post by:
Hi all, Use this code to make mouse tail using some image. You need to add an image control and a timer control to form. Load some image to image control. Image name : ImgBall Index : 0...
2
by: markszlazak | last post by:
In the following script, a control displays (black box) in each table cell once you mouse over the cell. Mouse down on the control to change the mode of the table. Drag the mouse over cells in the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.