Thread Subject: How to make background of uicontrols transparent?

Subject: How to make background of uicontrols transparent?

From: G.A.M.

Date: 28 Aug, 2007 22:32:47

Message: 1 of 2

I'd like the text of static text controls to be black and
the background to be transparent so it looks the same as the
figure background. Is this possible? Thanks

Subject: How to make background of uicontrols transparent?

From: Gautam Vallabha

Date: 29 Aug, 2007 13:06:19

Message: 2 of 2

In article <fb27qf$lit$1@fred.mathworks.com>, x0zero@gmail.com says...
> I'd like the text of static text controls to be black and
> the background to be transparent so it looks the same as the
> figure background. Is this possible? Thanks


h=uicontrol('style','text','string','hello');
parentColor = get(get(h, 'parent'), 'color');
set(h,'foregroundcolor', [0 0 0], ...
      'backgroundcolor', parentColor);

--
Gautam Vallabha
The MathWorks
Gautam.Vallabha@mathworks.com

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

Tag Activity for This Thread
Tag Applied By Date/Time
background color G.A.M. 28 Aug, 2007 18:35:21
figure G.A.M. 28 Aug, 2007 18:35:21
uicontrol G.A.M. 28 Aug, 2007 18:35:21
rssFeed for this Thread

Contact us at files@mathworks.com