Can the text in Textbox be highlighted when focused?

I need the text in the Textbox to be automatically Highlighted/Selected when Focused

Not highlighted text
image

Highlighted text
image

1 Like
TextBox.Focused:Connect(function()
	--do code
end)
1 Like

How does this solve my problem?

1 Like

So you want all text to be highlighted when it was focused?

1 Like

https://developer.roblox.com/en-us/api-reference/function/TextBox/CaptureFocus

yes i want all the text to be highlighted when focused

1 Like
local TextBox = script.Parent
TextBox:CaptureFocus()

I apologise for the 1st response, I thought you were just trying to detect a “Focused” event.

1 Like

CaptureFocus() is for setting the focus. I need the text in the TextBox to be Highlighted when focused

I was going to add to that script when I found some way of achieving what you’re trying to do but after extensive searching I don’t think that it’s possible. I was able to highlight text by double clicking but not after a single click.

1 Like