I have a form that uses a gradient as background color. I also have some label controls on the form. I would like the label control background color to be invisible, so that the background color from the form can be seen. Is that possible?
I don't think VB .NET supports transparent backgrounds for the Label control...
Can you get away without using the Label control? If you just need to display some text on the screen somewhere you could use the DrawString method of the Graphics class.
Example:
Code:
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
e.Graphics.DrawString("Hello", New Font("Arial", 12.0), New SolidBrush(Color.Black), 200, 200)
End Sub
However, on slower machines the label may paint with it's standard backcolor before the transparency is applied, making it look poor. TOAD's post is a more elegant solution.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.