Turn a checkbox green

5 Ansichten (letzte 30 Tage)
Andrew Reibold
Andrew Reibold am 1 Jul. 2013
I have a uitable in a GUI I made in Matlab guide.
I want a checkbox to turn green when its 'checked', and turn back red if its unchecked.
I cannot find a child property for this simple sounding task.

Akzeptierte Antwort

Evan
Evan am 1 Jul. 2013
Bearbeitet: Evan am 1 Jul. 2013
Using the Matlab properties of your checkbox, you can only change the color of the font ( ForegroundColor ) and it's highlighted color ( BackgroundColor ) for your checkbox. You cannot change the appearance of the box itself.
If you're wanting to accomplish an appearance change other than the two available modifications using the BackgroundColor and ForegroundColor properties, you'll have to modify Matlab's underlying Look-and-Feel. This will require quite a bit more work, but if you're interested, the below article may be of help:
  2 Kommentare
Andrew Reibold
Andrew Reibold am 1 Jul. 2013
Bearbeitet: Andrew Reibold am 1 Jul. 2013
I meant specifically a checkbox or logical column inside of a uitable. This sounds like if I just made a checkbox object. Thank you for your response. I'll make a new question and leave this here for others.
Evan
Evan am 1 Jul. 2013
Oh, apologies. I misread your question. Modifying the checkbox appearance within a uitable would likewise require modifying the underlying Java, though I would imagine that the fact that you're working within a uitable would add another layer of complexity. UndocumentedMatlab would probably be your best resource for this task as well.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu App Building finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by