Chaning Background color of disabled text area

28 views (last 30 days)
Just wondering if there is a way to change the background color of a text area when the editable property is set to 'off'
When the control is Enabled and Editable, the background changes as expected but when set to uneditable, the background turns grey regardless of background color specified.
I am trying create an output on a GUI similar to the command window in the MatLAB GUI but have a different background color. I also add to it providing information as to what the code is doing and don't want user input in this text area. If there is a better control for this rahther than Text Area I could switch
Any suggestions would be great.
  1 Comment
David Friesen
David Friesen on 29 Mar 2024
I found the solution to this at:
https://www.mathworks.com/matlabcentral/answers/564500-enable-disable-edittext-in-app-designer

Sign in to comment.

Answers (2)

Kennedy Kirkhope
Kennedy Kirkhope on 3 May 2022
I am actually using the App Designed so I would assume that is closer to GUIDE.
I am actually using a TextArea but once created, in the startupFcn(app) function I set the following:
app.Progress.Editable = 'off';
app.Progress.BackgroundColor = [0,0,0];
app.Progress.Enable = 'on';
But I see the background as grey. If I change the Editable to 'on' then it appears black as intended.
I tried reordering these tree commands but no such luck.
I was about to try obtaining a handle to the graphic object and seeing if that would allow me to override the default colour when the editiable flag is set 'off'
Any thoughts?
  1 Comment
RITAM BASU
RITAM BASU on 20 Sep 2022
same problem faced with TextArea in App designer.
Have you found a way out?

Sign in to comment.


Steven Lord
Steven Lord on 3 May 2022
Are you developing this using App Designer, GUIDE, or programmatically?
If App Designer, do you want to use a uitextarea instead of a uieditfield?
For GUIDE, does your uicontrol have Style 'edit' or 'text'?

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!