Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
how can i change the color of radio button ? Possible?

Subject: how can i change the color of radio button ? Possible?

From: st

Date: 27 Mar, 2011 07:22:05

Message: 1 of 5

Hi all,

I am intending to change the color of radio button. (neither the background nor foreground color).

But i dunno what is the properties of radio button i should use to change the color.

Please advise is it possible?

Many thanks!

Subject: how can i change the color of radio button ? Possible?

From: Steven_Lord

Date: 27 Mar, 2011 19:10:31

Message: 2 of 5



"st " <cell_st@hotmail.com> wrote in message
news:immoit$p1a$1@fred.mathworks.com...
> Hi all,
>
> I am intending to change the color of radio button. (neither the
> background nor foreground color).
>
> But i dunno what is the properties of radio button i should use to change
> the color.
>
> Please advise is it possible?

Use the BackgroundColor and ForegroundColor properties of the radiobutton
uicontrol.

http://www.mathworks.com/help/techdoc/infotool/hgprop/uicontrol_frame.html

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: how can i change the color of radio button ? Possible?

From: Yair Altman

Date: 27 Mar, 2011 22:42:04

Message: 3 of 5

"st " <cell_st@hotmail.com> wrote in message <immoit$p1a$1@fred.mathworks.com>...
> Hi all,
>
> I am intending to change the color of radio button. (neither the background nor foreground color).
>
> But i dunno what is the properties of radio button i should use to change the color.
>
> Please advise is it possible?
>
> Many thanks!

The color of the checkbox itself, as opposed to the color of the attached text label, cannot be configured via regular Matlab properties. It is set by your system's so-called "Look-and-Feel" (L&F), to appear consistent with the widgets normally presented on your platform.

You can modify these default settings, by setting a different L&F, as described here: http://UndocumentedMatlab.com/blog/modifying-matlab-look-and-feel

Alternately, you can modify your current L&F's properties. Malcolm Lidierth's MUtilities submission on the File Exchange can be a great help in this regard: http://www.mathworks.com/matlabcentral/fileexchange/28326

Yair Altman
http://UndocumentedMatlab.com

Subject: how can i change the color of radio button ? Possible?

From: Elsy Villarreal

Date: 7 Sep, 2011 02:30:27

Message: 4 of 5

Try this, maybe is not exactly what you want, but works :)

 basecir(:,:,1)=[196 193 190 207 62 86 91 67 212 191 195 201;
196 206 32 61 166 186 190 166 59 33 205 190;
199 38 180 209 227 229 232 231 215 179 35 198;
  219 71 215 250 255 255 251 253 252 215 61 210;
   67 169 230 250 255 255 254 255 253 225 167 62;
   87 186 227 255 254 248 255 253 253 227 186 88;
   86 191 227 253 252 255 255 251 252 228 186 86;
   64 166 226 252 255 253 251 254 254 226 168 67;
  219 64 215 254 255 253 252 255 253 213 60 211;
  197 38 176 215 226 231 230 225 214 174 36 194;
  196 206 34 65 169 189 190 163 60 35 207 193;
  199 190 195 210 67 88 86 64 214 195 193 204];

basecir(:,:,2)=[191 191 195 182 0 0 0 0 184 193 191 193;
  190 186 0 0 36 30 30 30 0 0 185 185;
  189 0 37 15 16 7 9 17 17 37 0 194;
  179 0 16 0 4 1 0 0 0 17 0 180;
    0 33 16 0 2 1 0 0 0 15 38 0;
    0 30 7 3 0 0 1 0 0 9 34 0;
    0 36 10 2 0 3 4 0 0 9 31 0;
    0 33 14 1 4 2 0 2 2 14 34 0;
  183 0 17 0 3 0 0 2 0 17 0 181;
  188 0 32 17 13 9 11 12 18 31 0 192;
  190 186 0 0 34 32 36 33 0 0 185 184;
  193 186 195 181 0 0 0 0 183 192 184 193];

basecir(:,:,3) =[197 194 189 177 0 0 0 0 181 190 188 191;
  194 187 0 0 34 31 32 32 0 0 184 182;
  190 0 29 5 9 4 10 17 16 35 0 193;
  180 0 11 0 0 0 0 1 0 16 0 178;
    0 35 18 0 4 3 5 6 2 14 33 0;
    0 33 9 5 2 0 5 3 2 7 29 0;
    0 40 5 0 0 0 1 0 0 7 29 0;
    0 36 10 0 0 0 0 0 1 13 35 0;
  185 0 16 0 0 0 0 4 3 19 0 181;
  189 0 32 16 7 4 9 14 20 33 0 193;
  192 187 0 0 28 27 34 31 0 0 187 187;
  197 187 193 175 0 0 0 0 178 187 185 197];
basecir=uint8(basecir);
set(handles.radiobutton1,''CData'',basecir);

That´s all, if you want another color, just modify the matrix basecir.

Subject: how can i change the color of radio button ? Possible?

From: st

Date: 7 Sep, 2011 02:54:11

Message: 5 of 5

hi ... thank you for your reply!

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us