uicontrol of pushbutton cannot set text color
2 次查看(过去 30 天)
显示 更早的评论
% Create a figure
fig = figure;
% Create a uicontrol button with red color
btn = uicontrol('Style', 'pushbutton', 'String', 'Click Me',...
'BackgroundColor', 'r',...
'ForegroundColor ', 'g',...
'Units', 'normalized', 'Position', [0.4 0.4 0.2 0.1]);
Error using uicontrol
There is no ForegroundColor property on the UIControl class.
0 个评论
采纳的回答
Epsilon
2024-9-25
编辑:Epsilon
2024-9-25
Hi raym,
Try removing the extra space after ForegroundColor.
Above mentioned code rectified:
% Create a figure
fig = figure;
% Create a uicontrol button with red color
btn = uicontrol('Style', 'pushbutton', 'String', 'Click Me',...
'BackgroundColor', 'r',...
'ForegroundColor', 'g',...
'Units', 'normalized', 'Position', [0.4 0.4 0.2 0.1]);
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!