#212950 - 2017-11-24 01:54 PM
TextBox[HELP]
|
AndreLuiz
Getting the hang of it
Registered: 2015-10-07
Posts: 89
Loc: Brasil, João pessoa
|
[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
|
Top
|
|
|
|
#213002 - 2017-11-27 02:03 PM
Re: TextBox[HELP]
[Re: Jochen]
|
Arend_
MM club member
Registered: 2005-01-17
Posts: 1895
Loc: Hilversum, The Netherlands
|
Works for me.
break on
$sys = createObject('kixtart.system')
$frm = $sys.form()
$frm.size = 450, 400
$tx = $frm.textbox
$tx.dock = 5
$tx.multiline = 1
$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
|
Top
|
|
|
|
#213006 - 2017-11-27 03:53 PM
Re: TextBox[HELP]
[Re: Arend_]
|
Arend_
MM club member
Registered: 2005-01-17
Posts: 1895
Loc: Hilversum, The Netherlands
|
|
Top
|
|
|
|
#213008 - 2017-11-27 04:25 PM
Re: TextBox[HELP]
[Re: Arend_]
|
Allen
KiX Supporter
Registered: 2003-04-19
Posts: 4549
Loc: USA
|
Mulit line.... HA! Business in the front and party in the back.
|
Top
|
|
|
|
#213013 - 2017-11-27 07:20 PM
Re: TextBox[HELP]
[Re: Arend_]
|
Jochen
KiX Supporter
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
|
Top
|
|
|
|
#213025 - 2017-11-29 05:02 AM
Re: TextBox[HELP]
[Re: Jochen]
|
AndreLuiz
Getting the hang of it
Registered: 2015-10-07
Posts: 89
Loc: Brasil, João pessoa
|
[PtBr] Muito obrigado pela ajuda!!! hahahh, funcionou no textbox, mas no richtextbox não funciona, veja.
[Eng] Thanks a lot for the help!!! hahahh, it ran in the textbox, but the richtextbox does not work, see.
break on
$sys = createObject('kixtart.system')
$frm = $sys.form()
$frm.size = 450, 400
$tx = $frm.Richtextbox
$tx.dock = 5
$tx.multiline = 1
$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
|
Top
|
|
|
|
#213075 - 2017-12-15 01:33 PM
Re: TextBox[HELP]
[Re: Arend_]
|
AndreLuiz
Getting the hang of it
Registered: 2015-10-07
Posts: 89
Loc: Brasil, João pessoa
|
[Eng(Translate)] Hello, pardon me for the delay. The error is displayed automatically by an image, notice a column where it is and tell what it should actually have there.
[PtBr] Olá perdoe-me pela demora. O erro estará autoexplicativo ao ver a imagem, repare a coluna onde está e conte o que deveria ter ali de fato.
[Eng(Translate)] I hope they get an algorithm that works with richtextbox, it would be very useful for me, thank you in advance!!
[PtBr] Espero que consigam um algorítimo que funcione com ritchtextbox, seria muito útil para mim, obrigado desde já!!
|
Top
|
|
|
|
Moderator: ShaneEP, Mart, Radimus, Jochen, Allen, Glenn Barnas
|
0 registered
and 370 anonymous users online.
|
|
|