|
-
Oct 20th, 2000, 02:29 PM
#1
Thread Starter
Addicted Member
Does anyone know how to get the x,y value of the current cursor position in a textbox? Preferably with a small api, but any method would be appreciated. Thanks
-
Oct 20th, 2000, 02:48 PM
#2
transcendental analytic
Code:
Ibeam = Text1.SelStart
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.
-
Oct 20th, 2000, 05:13 PM
#3
Frenzied Member
hmm... the X and the Y you ask?
Have you tried this?
Code:
Private Sub Text1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Text1.Text = X & " & " & Y
End Sub
oh and for the api to get the screen coordinates
Code:
Option Explicit
Private Type POINTAPI
X As Long
Y As Long
End Type
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Sub Text1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim Pnt As POINTAPI
GetCursorPos Pnt
Text1.Text = Pnt.X & " & " & Pnt.Y
End Sub
In the first code x = 0 when the mouse is at the left of the textbox, in the second code x = 0 when the mouse is at the left of the screen.
Have fun!
[Edited by Jop on 10-20-2000 at 06:22 PM]
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Oct 20th, 2000, 07:31 PM
#4
Thread Starter
Addicted Member
I meant
Jop i meant the x and y of the blinking cursor, not the mouse
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
|