Setting the cursor postion in TextArea
Setting the cursor postion in TextArea
I have been researching to find out how to set the cursor position to the beginning of a displayed text file loaded into a TextArea. I have no problem loading the file but the cursor is always at the end of the loaded file. What I want to do is have the text displayed at the beginning of the text. I have tried a few new commands but have had no results. Any help with this problem would be greatly appreciated..
Re: Setting the cursor postion in TextArea
Okay I figured it out. Found using the TextArea.Line command worked.
Example:
Example:
TextArea1.Line = 0
That will set the line back to the beginning of the text.- Quincunxian
- Posts: 173
- Joined: Sunday 25th June 2017 12:14am
- Location: Western Australia
Re: Setting the cursor postion in TextArea
Hi Cage,
I had a play around with this as I was curious to see what it could do and found that
I tried this; sort of expecting that the cursor would go to Pos 0 on the 2nd line :
As per the Gambas wiki - it may have something to do with the UTF-8 warning on byte counts ect.
I had a play around with this as I was curious to see what it could do and found that
TextArea.Pos = 0
may be a better solution.I tried this; sort of expecting that the cursor would go to Pos 0 on the 2nd line :
TextArea1.Text = "alkdfashdfasufdyasiudfhaskdjfhaskjdlfha" & Gb.CrLf & "ALKJDHFLKAJSHDFKJASHDFKAJLSHDFAJKSDHF"
TextArea1.Line = 1
It ended up on the second last character of the second line so I'm not really sure what it's doing?As per the Gambas wiki - it may have something to do with the UTF-8 warning on byte counts ect.
Cheers - Quin.
I code therefore I am
I code therefore I am
Re: Setting the cursor postion in TextArea
Thanks Quin I will give that a try.