Solved

Transparency of a label on a picturebox

Posted on 2004-07-31
2
680 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
Comment Utility
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
Comment Utility
you can change the label.parent property to your picturebox.

Dim myLabel as new Label
myLabel.Parent = myPictureBox
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

763 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

12 Experts available now in Live!

Get 1:1 Help Now