Scroll Multiline EditText

splatt

Active Member
Licensed User
Longtime User
I have an EditText that acts as a log for an ongoing process.

Is it possible to automatically scroll this so that the latest text added is visible?
 

texwillerx

Member
Licensed User
Longtime User
Dear Klaus,

I have a long text with lots of lines separated by CRLF. I want to bring start of a line in the middle of the edittext, so that it will be visible as a whole.

I tried your code

EditText1.SelectionStart = EditText1.Text.Lenght.

Unfortunately, this code brings the beginning of the line at the end of the edit text. Therefore, if the line is long, the rest of the line is not visible.

Is there another way to overcome this problem.

Thanks in advance for your valuable help.

Best regards.

PS: In fact, I need a way to select some text in edittext and set its backgound to another color. The richstring library only sets the textcolor.

A code such as

edittext1.selstart=x
edittext1.sellength=y
edittext1.selcolor=colors.red
edittext1.selbackcolor=colors.yellow

would be extremely usable.

PS: This edittext will be read only.
 
Last edited:
Upvote 0

klaus

Expert
Licensed User
Longtime User
A code such as

edittext1.selstart=x
edittext1.sellength=y
edittext1.selcolor=colors.red
edittext1.selbackcolor=colors.yellow
Directly in B4A it's not possible.

I don't know if it would be possible with the reflection library.
But my knowledge of Android and Reflection is not at that level.

Best regards.
 
Upvote 0

Ali Bidokhti

New Member
Hi.
I Want to my EditText scroll but still be readonly!
Edit Text may scroll when containing huge texts, but I want it to read only.
if it is readonly , i.e. Enabeled =false, it won't scroll!
how can I solve this problem?
 
Upvote 0
Top