Path: news.mathworks.com!not-for-mail
From: Gautam Vallabha <Gautam.Vallabha@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to make background of uicontrols transparent?
Date: Wed, 29 Aug 2007 09:06:19 -0400
Organization: The MathWorks
Lines: 15
Message-ID: <MPG.213f395893e94e8989698@news.mathworks.com>
References: <fb27qf$lit$1@fred.mathworks.com>
NNTP-Posting-Host: vallabhag.dhcp.mathworks.com
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-15"
Content-Transfer-Encoding: 7bit
X-Trace: fred.mathworks.com 1188392779 11320 144.212.219.54 (29 Aug 2007 13:06:19 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 29 Aug 2007 13:06:19 +0000 (UTC)
User-Agent: MicroPlanet-Gravity/2.70.2067
Xref: news.mathworks.com comp.soft-sys.matlab:426073



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