Transparent Label...

D

Daniel

Hi,

Sorry to repost this again... I really ran out of idea and resources to
figure out how to make this work... Hope someone will help. Thanks :)

I've tried the transparent for backcolor, but it doesn't work.
The below is the coding to draw the gradient. Could that be other way of
writing?
System.Drawing.Drawing2D.LinearGradientBrush brush = new
System.Drawing.Drawing2D.LinearGradientBrush(new
System.Drawing.RectangleF(0,0, this.Width, this.Height), Color.Blue,
Color.SkyBlue, System.Drawing.Drawing2D.LinearGradientMode.Vertical);

graphics g = this.CreateGraphics();

g.FillRectangle(brush, new RectangleF(0,0,this.Width, this.Height));

g.Dispose();


Thank you.


Regards,
Daniel


Morten Wennevik said:
Hi Daniel,

Set the label's BackGroundColor = Color.Transparent

If you use ClipRectangle for your gradient calculation the gradient for
the label will be different than the background.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top