Solved

Transparency of a label on a picturebox

Posted on 2004-07-31
2
686 Views
Last Modified: 2006-11-17
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
Comment
Question by:Vermeij
2 Comments
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 11685910
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
 
LVL 4

Accepted Solution

by:
srcalc earned 125 total points
ID: 11686044
you can change the label.parent property to your picturebox.

Dim myLabel as new Label
myLabel.Parent = myPictureBox
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now