Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 717
  • Last Modified:

Transparency of a label on a picturebox

When a label is placed on top of  a picturebox containing an image,
and the backcolor of the label is set to transparent, it does not work.
The backcolor of the label is stil grey. How can I fix this ???

Thanks...
0
Vermeij
Asked:
Vermeij
1 Solution
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
When the Backcolor of a control is set to Transparent it takes on the colors of its Parent container.  The PictureBox control is NOT a container, so the Label is most likely getting its background color from the Form itself.

One way around this is to use a Panel control instead of a PictureBox.  Set the BackgroundImage property to the picture you want to display and place the Label inside the Panel.  Now when the BackColor of the Label is set to Transparent, the picture will show through the Label as expected.

Regards,

Idle_Mind

0
 
srcalcCommented:
you can change the label.parent property to your picturebox.

Dim myLabel as new Label
myLabel.Parent = myPictureBox
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now