Re: How can I set a label transparent? by Morten
Morten
Fri May 14 03:46:33 CDT 2004
Hi Rudy,
A way around this, not using labels, is to drawstring the text directly onto the picturebox. You can still put a label ontop of the picturebox and use it in design and at runtime, but set it to visible = false and let the drawstring paint it, using whatever property label1 has.
private void pictureBox1_Paint(object sender, PaintEventArgs e)
{
e.Graphics.DrawString(label1.Text, label1.Font, new SolidBrush(label1.ForeColor), label1.Left - pictureBox1.Left, label1.Top - pictureBox1.Top);
}
Happy coding!
Morten Wennevik [C# MVP]