how do I change Matlab GUI components color?

39 Ansichten (letzte 30 Tage)
fatih orman
fatih orman am 31 Mär. 2020
Kommentiert: Geoff Hayes am 19 Dez. 2021
I want to make a dark mode, normal mode feature in userpanel with Radio buttons in my GUI panel with the code like down below. I can change panel backgroundcolour, but how can I adapt this code for other parts like below?
uibuttongroup, text, pushbutton (foregroundcolor, backgroundcolor, highlightcolor)
that works good;
set ( gcf, 'Color', [0 0 0] )
at these examples I'm getting error;
set ( edit1, 'Color', [0 0 0] )
set ( edit1, 'BackgroundColor', [0 0 0] )
set ( edit1, 'ForegroundColor', [0 0 0] )

Akzeptierte Antwort

Geoff Hayes
Geoff Hayes am 31 Mär. 2020
Bearbeitet: Geoff Hayes am 31 Mär. 2020
fatih - what is the full error message that you are observing? Are you using GUIDE, App Designer, or have you created your GUI programmatically? If using GUIDE, then you will need to use the handles structure to reference your edit1 control
set(handles.edit1, 'BackgroundColor', [0 0 1]);
The background color can be changed. Programmatically this can be done as
hEditControl = uicontrol('Style','edit');
set(hEditControl, 'BackgroundColor', [0 0 1]);
  3 Kommentare
Mai Thành
Mai Thành am 19 Dez. 2021
How can I change the font of the output text by using that structure ?
Geoff Hayes
Geoff Hayes am 19 Dez. 2021
@Mai Thành - see font for details.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Interactive Control and Callbacks finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by