Switch Class change background color on event

5 visualizaciones (últimos 30 días)
Mark Pickell
Mark Pickell el 17 de Jul. de 2022
Comentada: Walter Roberson el 17 de Jul. de 2022
I have some simple on/off switches that I would like to alter the background color depending on the state. If Off background red, if on background green. The font color works for the switches but whenever I try to use Backgroundcolor designerapp tells me unrecognized property for the Switch class.

Respuestas (1)

Walter Roberson
Walter Roberson el 17 de Jul. de 2022
https://www.mathworks.com/help/matlab/ref/matlab.ui.control.switch-properties.html#bucxdj3-1_sep_shared-FontColor
The only color control for uiswitch() is font color. There is also no ability to add graphics to uiswitch()
This is different than the older uicontrol which offered more customization.
  1 comentario
Walter Roberson
Walter Roberson el 17 de Jul. de 2022
uibutton() allows BackgroundColor
https://www.mathworks.com/help/matlab/ref/matlab.ui.control.button-properties.html#d123e1680176

Iniciar sesión para comentar.

Categorías

Más información sobre Graphics Performance en Help Center y File Exchange.

Productos


Versión

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by