MATLAB: Enable or Disable an Edit Text

guiguidematlab gui

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.

Best Answer

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.