|
-
Jun 19th, 2000, 08:20 AM
#1
Thread Starter
Lively Member
What would be the code for any size of button to keep the cursor off of it?
Timbudtwo
I have no life, only one with computers.
VB 6.0 Enterprise Edition
[hr]
-
Jun 19th, 2000, 08:31 AM
#2
transcendental analytic
you mean having cursor avoiding that area? Use Setcursorpos api to move cursor
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 19th, 2000, 08:37 AM
#3
Thread Starter
Lively Member
what is that?
well I sorta wanted the code, the button in the size of 6 of those little dots on the form.
Timbudtwo
I have no life, only one with computers.
VB 6.0 Enterprise Edition
[hr]
-
Jun 19th, 2000, 08:45 AM
#4
transcendental analytic
Try something like this:
Code:
Private Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
Private Declare Function ClientToScreen Lib "user32" (ByVal hwnd As Long, lpPoint As POINTAPI) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim pt As POINTAPI
pt.x = x / Screen.TwipsPerPixelX
pt.y = y / Screen.TwipsPerPixelY
Caption = pt.x
ClientToScreen Command1.hwnd, pt
SetCursorPos pt.x - y / Screen.TwipsPerPixelX, pt.y - y / Screen.TwipsPerPixelY
End Sub
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 19th, 2000, 09:03 AM
#5
Thread Starter
Lively Member
nope
Private Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
Private Declare Function ClientToScreen Lib "user32" (ByVal hwnd As Long, lpPoint As POINTAPI) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim pt As POINTAPI
pt.x = x / Screen.TwipsPerPixelX
pt.y = y / Screen.TwipsPerPixelY
Caption = pt.x
ClientToScreen Command1.hwnd, pt
SetCursorPos pt.x - y / Screen.TwipsPerPixelX, pt.y - y / Screen.TwipsPerPixelY
End Sub
doen't work
what would?
Timbudtwo
I have no life, only one with computers.
VB 6.0 Enterprise Edition
[hr]
-
Jun 19th, 2000, 09:12 AM
#6
Frenzied Member
Works for me
Just change it a little. Add a module and declare the API's and the Type Public there:
In a basic module:
Code:
Public Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
Public Declare Function ClientToScreen Lib "user32" (ByVal hwnd As Long, lpPoint As POINTAPI) As Long
Public Type POINTAPI
x As Long
y As Long
End Type
And in the form's code window:
Code:
Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim pt As POINTAPI
pt.x = x / Screen.TwipsPerPixelX
pt.y = y / Screen.TwipsPerPixelY
Caption = pt.x
ClientToScreen Command1.hwnd, pt
SetCursorPos pt.x - y / Screen.TwipsPerPixelX, pt.y - y / Screen.TwipsPerPixelY
End Sub
-
Jun 19th, 2000, 07:57 PM
#7
transcendental analytic
What did you change? It worked on mine. also remove that caption line, it's not nessesary
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
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
|