Hello,
I would like to know how to set the text entered in a TextBox all capitalised. Is there a way to do that? I have been surfing on the web to know how to do it and all I found was some JavaScript.
Thanks
Hello,
I would like to know how to set the text entered in a TextBox all capitalised. Is there a way to do that? I have been surfing on the web to know how to do it and all I found was some JavaScript.
Thanks
I would do it by connecting a changed event to its Text
property, and then setting its text to its text capitalized.
Example:
local textbox = script.Parent
textbox:GetPropertyChangedSignal("Text"):Connect(function()
if textbox.Text:upper() ~= textbox.Text then
textbox.Text = textbox.Text:upper()
end
end)
From my testing it seems to preserve the cursor position within the text, but if it didn’t, you could maintain it by using the CursorPosition
property.
Thanks I will try that out… (())