Transparent Text - Should be easy

R

R-D-C

Hi,

I am a newbie to Windows Forms but this should be easy. I have a picturebox
showing a banner on my screen. I wasnt to place two labels over this
picture with transparent backgrounds so the white background does not
obscure the image.

I have put a label and a link label on the picture, set both BackColor
properties to Transparent but the white rectangle behind the text won't go
away.

Where am I going wrong, please help!
 
K

Ken Tucker [MVP]

Hi,

When you set the background color of a control to transparent it
uses its parents color. Set the label and linklabel parent to the
picturebox and adjusts it location.

Label2.Parent = PictureBox1

LinkLabel1.Parent = PictureBox1

Label2.BackColor = Color.Transparent

LinkLabel1.BackColor = Color.Transparent

Label2.Location = New Point(0, 0)

LinkLabel1.Location = New Point(0, 20)

Ken
 
R

R-D-C

Thanks Ken, that kind ofworked .

However, the labels now show the image through their transparent areas but
where the two labels overlap, the transparency doesn't work. Is there not a
way to set up transparency like the old Visual Basic method where everything
could show through the transparent background areas?

Cheers

RDC
 
M

Michael Bray

However, the labels now show the image through their transparent areas
but where the two labels overlap, the transparency doesn't work. Is
there not a way to set up transparency like the old Visual Basic
method where everything could show through the transparent background
areas?

I think this is because Transparency (as currently implemented) isn't true
transparency, it only shows what is on the parent control. In otherwords,
sibling controls that overlap aren't accounted for.

-mbray
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top