Live Chat Icon For mobile
Live Chat Icon

I’m trying to make the background of my linklabel transparent so a picturebox will show through it. However, if I set the link label’s BackColor property to Transparent the label still has a white background. Why

Platform: WinForms| Category: Controls

Controls with a ‘Transparent’ color actually render their parent’s background, so you’re seeing the White background of the Form, not the PictureBox. Three easy ways to deal with this:

  • Use a Panel with it’s ‘BackgroundImage’ property set instead of a PictureBox, and parent the LinkLabels to the panel (PictureBoxes generally don’t have children)
  • Set the BackgroundImage of the Form to the image (basically the same as 1 above, but avoids the extra control)
  • In code, set the Parent of the LinkLabel to be the PictureBox. You’ll need to update the LinkLabel’s position to match the new origin of the parent if the PictureBox isn’t at (0,0)

(Shawn Burke on microsoft.public.dotnet.framework.windowsforms newsgroup)

Share with

Share on twitter
Share on facebook
Share on linkedin

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.