Transparent Text - Should be easy

  • Thread starter Thread starter R-D-C
  • Start date Start date
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!
 
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
 
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
 
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
 
Back
Top