Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Text box item caret position
Hello again,

Is it possible to get/set caret position in a textbox accessible object?

Thank you,
Maybe this will be useful

Search forum for GetCaretXY
I mean the caret line position, e.g. 4th line from the top of the document
I was attempting to use Scintilla messages (code below) without success. I suspect it only works for the qm editor?
Copy      Help
int GoToLineNumber 3
int h = id(15 "Notepad")
SendMessage(h SCI.SCI_GOTOLINE GoToLineNumber-1 0)
Copy      Help
int LineNumber=10
int w=win("- Notepad" "Notepad")
int c=id(15 w) ;;editable text 'Text Editor'
LineNumber-1 ;;(line numbers start at zero so need to subtract 1)
int ci=SendMessage(c EM_LINEINDEX LineNumber 0);;
SendMessage(c EM_SETSEL ci ci)
That works! thanks a lot!

Forum Jump:

Users browsing this thread: 1 Guest(s)