I need to have text displayed over a picturebox with an image in it. When
using a label whose BackColor = System.Drawing.Color.Transparent, the
background is not transparent.

I came across this explanation as to why .Net does not support transparent
backgrounds.

************
[In Visual Basic 6.0, the BackStyle property of the Label control determined
whether the label had a transparent background. Setting the BackStyle
property to 0 â?? Transparent allowed any background image or other controls to
show through the label.

In Visual Basic .NET, the BackStyle property no longer exists, and the
transparency behavior is slightly different. To emulate the transparent
behavior in Visual Basic .NET, set the BackColor property to
System.Drawing.Color.Transparent. This will allow the background image to
show through, but it will not be transparent in regard to other controls.]
**********************

The last phrase is mindboggling, " . . . but it will not be transparent in
regards to other controls." What good it is then??? Why would any lanquage
designer not support such a useful property?

How do I get a label to have a true transparent background??

WR





--
William R

Re: Label with Transparent Background by Chris

Chris
Mon Jan 03 10:33:00 CST 2005

When you set the label to transparent, it is transparent only to its
parent, in this case the form, so it shows the form's background
through the label.

If you want to to show the picture box through the label, you must set
the parent of the label to be the picture box:
Label1.Parent = PictureBox1

Then the label will display properly.


Re: Label with Transparent Background by Thomas

Thomas
Tue Jan 04 08:41:58 CST 2005


"WhiskyRomeo" <WhiskyRomeo@discussions.microsoft.com> schrieb im Newsbeitrag
news:BD1C838C-058A-4740-843A-67BD744A9F18@microsoft.com...
> I need to have text displayed over a picturebox with an image in it. When
> using a label whose BackColor = System.Drawing.Color.Transparent, the
> background is not transparent.
>
> I came across this explanation as to why .Net does not support transparent
> backgrounds.
>
> ************
> [In Visual Basic 6.0, the BackStyle property of the Label control
determined
> whether the label had a transparent background. Setting the BackStyle
> property to 0 - Transparent allowed any background image or other controls
to
> show through the label.
>
> In Visual Basic .NET, the BackStyle property no longer exists, and the
> transparency behavior is slightly different. To emulate the transparent
> behavior in Visual Basic .NET, set the BackColor property to
> System.Drawing.Color.Transparent. This will allow the background image to
> show through, but it will not be transparent in regard to other controls.]
> **********************
>
> The last phrase is mindboggling, " . . . but it will not be transparent in
> regards to other controls." What good it is then??? Why would any
lanquage
> designer not support such a useful property?
>
> How do I get a label to have a true transparent background??
>
> WR
>
>
>
>
>
> --
> William R

Hi William,

read this:
http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=2132&lngWId=10

Greeting

Thomas



Re: Label with Transparent Background by WhiskyRomeo

WhiskyRomeo
Tue Jan 04 17:35:02 CST 2005

This works for me for now. Thanks a lot.

wr

"Chris" wrote:

> When you set the label to transparent, it is transparent only to its
> parent, in this case the form, so it shows the form's background
> through the label.
>
> If you want to to show the picture box through the label, you must set
> the parent of the label to be the picture box:
> Label1.Parent = PictureBox1
>
> Then the label will display properly.
>
>

Re: Label with Transparent Background by WhiskyRomeo

WhiskyRomeo
Tue Jan 04 17:37:01 CST 2005

thanks for the link. I going to use this.

wr

"Thomas Wenning" wrote:

>
> "WhiskyRomeo" <WhiskyRomeo@discussions.microsoft.com> schrieb im Newsbeitrag
> news:BD1C838C-058A-4740-843A-67BD744A9F18@microsoft.com...
> > I need to have text displayed over a picturebox with an image in it. When
> > using a label whose BackColor = System.Drawing.Color.Transparent, the
> > background is not transparent.
> >
> > I came across this explanation as to why .Net does not support transparent
> > backgrounds.
> >
> > ************
> > [In Visual Basic 6.0, the BackStyle property of the Label control
> determined
> > whether the label had a transparent background. Setting the BackStyle
> > property to 0 - Transparent allowed any background image or other controls
> to
> > show through the label.
> >
> > In Visual Basic .NET, the BackStyle property no longer exists, and the
> > transparency behavior is slightly different. To emulate the transparent
> > behavior in Visual Basic .NET, set the BackColor property to
> > System.Drawing.Color.Transparent. This will allow the background image to
> > show through, but it will not be transparent in regard to other controls.]
> > **********************
> >
> > The last phrase is mindboggling, " . . . but it will not be transparent in
> > regards to other controls." What good it is then??? Why would any
> lanquage
> > designer not support such a useful property?
> >
> > How do I get a label to have a true transparent background??
> >
> > WR
> >
> >
> >
> >
> >
> > --
> > William R
>
> Hi William,
>
> read this:
> http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=2132&lngWId=10
>
> Greeting
>
> Thomas
>
>
>