Using C # WinForms I have a form in which I draw a gradient background from blue to blue on it. I have several buttons and several shortcuts on which I have already tried setting the reverse color to transparent , since I want the background to appear - especially for shortcuts, but it doesn't seem to work.
But I noticed that the picture is also superimposed, although the code is present only in the form_paint event.
How can I make the labels not the same shading, but transparent? for example, the labels at the top of the form will be light blue and the bottom will be dark blue.
private void frmOptions_Paint(object sender, PaintEventArgs e)
{
e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;
Rectangle rectangle = e.ClipRectangle;
using (Brush aBrush = new LinearGradientBrush(rectangle, Color.LightBlue, Color.DarkBlue, LinearGradientMode.Vertical))
{
e.Graphics.FillRectangle(aBrush, rectangle);
}
}
Thanks so much for any help with this.
EDIT:
, EACH - , 2 . , .
2:
(. ), , paint . , "Rectangle rectangle = e.ClipRectangle;" - . ClipRectangle - ... ? , , , Reniuz.
3
cliprightangle "Rectangle rectangle = new Rectangle(0, 0, this.Width, this.Height);". , , , - 7, 8 :( , "TransparentLabel", .