Why does the BackgroundColor of an editable textbox remain white when it has been set to another color in MATLAB 7.7 (R2008b)?
Show older comments
I created an editable text box with a BackgroundColor of [0 0.7 0.7]. If I assign a value to the 'String' property while the 'Enable' setting is 'off', the resulting text box will be white isntead of the assigned BackgroundColor. This is contingent upon both setting the String value and the Enable off
%%works
fh=figure
t=uicontrol(fh,'Style','edit','BackgroundColor',[0 .7 .7],'Enable','off')
set(t,'Enable','on')
%%works
fh2=figure
t2=uicontrol(fh2,'Style','edit','BackgroundColor',[0 .7 .7])
set(t2,'String','Hello World')
set(t2,'Enable','on')
%%breaks
fh3=figure
t3=uicontrol(fh3,'Style','edit','BackgroundColor',[0 .7 .7],'Enable','off')
set(t3,'String','Hello World')
set(t3,'Enable','on')
GUIs created in GUIDE are also affected.
Accepted Answer
More Answers (0)
Categories
Find more on Interactive Control and Callbacks in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!