Filter löschen
Filter löschen

Enable or Disable an Edit Text

22 Ansichten (letzte 30 Tage)
Melvin
Melvin am 24 Feb. 2012
Kommentiert: Mike D. am 28 Feb. 2017
Hi everyone. What code to use under a push button if I want to enable or disable an "edit text" when that push button is clicked? Thank you very much.
  1 Kommentar
Melvin
Melvin am 24 Feb. 2012
I hope someone answers my question...Thank you in advance

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 24 Feb. 2012
set(handles.TheTextBox, 'enable', 'off')
Note: there is also 'disable' instead of 'off'. When it is 'disable', the text is still there and still readable and scrollable, but cannot be changed.
  2 Kommentare
Patrick
Patrick am 15 Mai 2013
It's actually 'inactive', not 'disable', instead of 'off'. Maybe they changed it. But I see no significant difference between the two other than 'off' greys out the background while 'inactive' leaves it white. But neither one of them allow for selecting/highlighting.
Mike D.
Mike D. am 28 Feb. 2017
No, they didn't change it, the "Enable" property of an edit box has three modes: on, off or inactive. The user can only modify it contents when Enable = on. Yea, off greys it out while inactive leaves it white. I noticed if you use an edit box as a memo box with many lines of text (and vertical scroll bar), you can't use the vertical scroll bar if the edit box is off, but can if its inactive.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by