How to change background color of GUI

69 ビュー (過去 30 日間)
Scott
Scott 2014 年 10 月 29 日
回答済み: hareesh h 2017 年 6 月 4 日
I am trying to figure out the MATLAB command which will set the background color for the background of the GUI itself (to change it from the default grey). I have done some searching and have found some stuff, but this code only seems to change the color of the buttons which I have inside the GUI, not the overall background of the GUI. Any thoughts?
Here's the code that changes the buttons:
set(0,'DefaultUicontrolBackgroundColor',[1 0 0]);

回答 (2 件)

Robert Cumming
Robert Cumming 2014 年 10 月 30 日
does this do what you want:
set ( 0, 'DefaultFigureColor', [1 0 0] )
you can se the colour of any individual figure:
set ( gcf, 'Color', [1 0 0] )
or its best to keep track of your figures rather than assume gcf will be the one you want:
hFig = figure;
set ( hFig, 'Color', [1 0 0] )
  1 件のコメント
Scott
Scott 2014 年 10 月 30 日
yes it does, thanks!

サインインしてコメントする。


hareesh h
hareesh h 2017 年 6 月 4 日
Working solution. Thank you

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by