x


Select text in GUI TextField

When using the GUI TextField, do you guys know if it is possible to make the text in the TextField selected from code?

more ▼

asked May 12 '10 at 09:10 AM

KvanteTore gravatar image

KvanteTore
1.5k 8 15 33

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Focusing the TextField should, IIRC, select it's text, when it is not already focused. Try GUI.FocusControl() in combination with GUI.SetNextControlName().

more ▼

answered May 12 '10 at 04:33 PM

jonas echterhoff gravatar image

jonas echterhoff ♦♦
9.7k 7 23 102

Unfortunately, that does not seem to work.

May 21 '10 at 04:04 PM KvanteTore

Yep, doesn't work. Well, it does maybe the first time or something, but nothing reliable.

Anyone else know of a way?

Sep 07 '11 at 01:10 AM Waz

You must first focus something else (doesn't matter what, so long as it exists, "" or null will not suffice). Bit of an ugly kludge, but seems to work.

Sep 07 '11 at 01:16 AM Waz
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3676
x150

asked: May 12 '10 at 09:10 AM

Seen: 2888 times

Last Updated: Sep 07 '11 at 01:17 AM