Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i was trying to make my label transparent so that the background show what's behind it
Posted
Comments
Anshul R 8-Jun-10 10:47am    
Reason for my vote of 1
The question is not clear

What's your background, your Form, a Picturebox???

Form (in form_load):

Label1.Parent = Me
Label1.BackColor = Color.Transparent



Picturebox (in form_load):

Label1.Parent = PictureBox1
Label1.BackColor = Color.Transparent
 
Share this answer
 
Please Specify Your Visual Basic Version

Is it VB.NET?

If so, set the BackColor property of the label to Transparent

IN VB6,
Set the BackStyle Property to 0(Transparent)

The code in VB.NET for a label named Label1 would be

Label1.BackColor=Color.Transparent


The Code in VB6 for a label named Label1 would be

Label1.BackStyle=0
 
Share this answer
 
v3
This article's code contains a transparent label control that I have found useful on numerous occasions:

SimpleLine line and box graphics controls[^]
 
Share this answer
 
Comments
Scubapro 8-Jun-10 10:52am    
This is in C#, not VB.
Johnny J. 8-Jun-10 10:54am    
True, but if you compile it into a dll, it can be easily used from VB too. I do it all the time.
Anyway, I think I have the code in VB as well somewhere, so give me 10 minutes and I'll try to find it.
Johnny J. 8-Jun-10 11:01am    
Apparently, comments are restricted in length, so I can't paste the code. Here's a link:

http://www.codeproject.com/Tips/86475/Transparent-Label-in-VB.aspx

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900