Selecting text box content

Hello community members,
How can I select (not focus) a text content of a text box after clicking a button.
I would appreciate it if someone can give me a hint or possibly a code snippet.
Thanks
Daniel

Do you want to:

highlight it ?
copy it to the clipboard ?

or both ?

Hi,
Thank you for the quick response.
suppose that I have already entered a number in a text box. I need the pre-existing text to be selected upon a button click which is used for some calculation.

maybe it is better to post a screenshot from a sample. :blush:

text selection sampl
I just want it to be selected and be ready for the next input. I want to be able to overwrite the selected text by entering the next input.
many thanks

you just want it highlighted then?
(the textbox.text block can be used to get the value for the calculation)

ohh!
is it what it is called in appinventor? highlighting?
I thought it is considered a selection! :thinking: :thinking:

I can have access to the text value. I just need it to be "highlighted". :blush:

If you want to highlight the text then you will need to use Taifun's textbox extension:

https://puravidaapps.com/textbox.php

Alternatively, you could just change the background colour of the textbox when you press the button.....

1 Like

Dear TIMAI2,
Thank you for the tip. I will give it a try and let you know about the result.
I appreciate your help.
cheers.

Dear TIMAI2,
Thank you for your help.
It was a nice extension. :smiley: :smiley:
Best

Why not set the textbox's .Text to an empty text in the button Click event after using the contents?

Dear ABG,
Thank you for your reply.
I thought about that, but I wanted the previous text to be visible and then be overwritten later.
I appreciate sharing your idea anyway.
best

I coded a project that deals with that recently ...

Dear ABG,
Thank you for sharing the code.
best
Daniel