• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 706
  • 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

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

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