[PtBr]
Olá a todos, eu gostaria de saber como faço para saber onde o cursor de digitação está dentro do texto como um todo.
[Eng]
Hello everyone, I would like to know how do I know where the typing cursor is inside the text as a whole.
break on
$sys = createObject('kixtart.system')
$frm = $sys.form()
$frm.size = 450, 400
$tx = $frm.textbox
$tx.dock = 5
$tx.text = 'ola1'+@crlf+'ola2'+@crlf+'ola3'+@crlf
$frm.show
while $frm.visible
$=Execute($frm.doevents(1))
sleep 0.05
$ln = ubound(Split($tx.text, @crlf))+1
$lns = ubound(Split(substr($tx.text, 1, $tx.SelectionStart+1), @crlf))+1
$tx.SelectionStart-1?
Len($tx.text)-$ln?
$ln?
$frm.text =
"Length:"+Cstr(Len($tx.text))+
" | Lines:"+cstr($ln)+
" | Pos:"+Cstr($tx.SelectionStart+1)+
" | Line pos:"+cstr($lns)
$lns = 0
$text = ''
loop