-
Feb 29th, 2008, 07:00 AM
#1
Thread Starter
Lively Member
[RESOLVED] CheckBox MouseMove method not behaving as advertised
I am trying to do some manipulation based on x,y arguments supplied by the MouseMove event but they appear to be coming through as twips at runtime rather than pixels.
MSDN says:
(x,y) - A number that specifies the current location of the mouse pointer. The x and y values are always expressed in terms of the coordinate system set by the ScaleHeight, ScaleWidth, ScaleLeft, and ScaleTop properties of the object.
The parent container has ScaleMode set to pixels so what's going on here?
-
Feb 29th, 2008, 07:27 AM
#2
Re: CheckBox MouseMove method not behaving as advertised
Every windows control has its own device context. As far as I can remember, even PictureBox scalemodes stay as Twips when your parent form is set to Pixels.
What you can do.. is convert it. Something like..
Code:
Private Sub CheckBox_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
X = X / Screen.TwipsPerPixelX
Y = Y / Screen.TwipsPerPixelY
Debug.Print "X: "; X
Debug.Print "Y: "; Y
End Sub
chem
Last edited by chemicalNova; Feb 29th, 2008 at 07:31 AM.
Visual Studio 6, Visual Studio.NET 2005, MASM
-
Mar 3rd, 2008, 02:00 AM
#3
Thread Starter
Lively Member
Re: CheckBox MouseMove method not behaving as advertised
Thanks chem...that worked.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|