Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I disable typing in text boxes?

Asked by 9 years ago

I cant find a property for this, so how?

0
Use a textlabel. HungryJaffer 1246 — 9y
0
DO NOT USE A TEXTLABEL, look at my answer DevChris 235 — 9y
0
If you meant to use a TextLabel, use a TextLabel. If you're disabling a textbox for some other reason, follow devChris's answer. 1waffle1 2908 — 9y

2 answers

Log in to vote
1
Answered by
DevChris 235 Moderation Voter
9 years ago

The TextBox has an event called Focused which runs every time someone focuses their mouse on the box. Using this, we can also unfocus it when this event is called, so it gives an illusion of a disabled textbox.

local textBox = yourTextBoxPathHere -- (for example, gui.TextBox)
textBox.Focused:connect(function() -- Event called
    textBox:ReleaseFocus() -- Makes it disable typing
end)
Ad
Log in to vote
0
Answered by 9 years ago

By using a TextLabel. Whoops, excuse my while I fix all of my GUI's.

0
It's the only way I know of. HungryJaffer 1246 — 9y
0
This is a terrible and time consuming way, look at my answer. DevChris 235 — 9y
0
Eh, did it now! Sharpthy 46 — 9y

Answer this question