Finding coordinates for the textcursor (1 Viewer)

Shas91

Member
Local time
Today, 10:12
Joined
Nov 26, 2019
Messages
41
Hi !

Got stucked... I have no problem to find the coordinates för the mouse pointer but when I tried to get it for the text cursor it won't work. Is there someone who can give me some help

// Shas
 

sonic8

AWF VIP
Local time
Today, 19:12
Joined
Oct 27, 2015
Messages
998
Coordinates of the text cursor (caret) are usually not very relevant. You can get the control having the focus, and thus the caret, with ActiveControl. SelStart will give you the (character) position of the caret in a text box control.

If this doesn't help, you should explain the back story for your question.
 

Shas91

Member
Local time
Today, 10:12
Joined
Nov 26, 2019
Messages
41
I know... But in my case I run a complete diffrent program by vba code. In this case I want to scroll down an invoice opened in Foxit Reader by pressing a key...

Its not so hard as i sounds, pretty easy infact... When Key pressed down..... I move the mousepointer to Foxit and click in it to activate it by code then send keys "page down" and ofcourse correct the enoying problem with numlock... So far so god...

The problem is to go back to the the place where I started from...
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 01:12
Joined
May 7, 2009
Messages
19,245
you can Save the Screen.ActiveControl and the SelStart Value of the textbox before "jumping" to foxit.
when you return, Setfocus to the saved control and set it's SelStart to the one you saved.
 

Users who are viewing this thread

Top Bottom