D
David Clegg
I'm trying to create a WinForm with a Linear Gradient background.
That's easy enough, but any Labels I have on the form do not have their
background painted correctly. Even though I have Label.BackColor set to
Color.Transparent, it is using the original BackColor of the Form. Here
is my code, which is called in the Paint event for the Form ...
private void LoginForm_Paint(object sender,
System.Windows.Forms.PaintEventArgs e) {
LinearGradientBrush brush = new LinearGradientBrush(
this.ClientRectangle, Color.Black, Color.Blue,
LinearGradientMode.Vertical);
e.Graphics.FillRectangle(brush, this.ClientRectangle);
}
Am I going to have to override the Paint event for the Label components
as well and manually output the text?
--
Cheers,
David Clegg
dclegg_at_ebetonline_dot_com
"Where's the 'Any' Key?" - Homer Simpson
That's easy enough, but any Labels I have on the form do not have their
background painted correctly. Even though I have Label.BackColor set to
Color.Transparent, it is using the original BackColor of the Form. Here
is my code, which is called in the Paint event for the Form ...
private void LoginForm_Paint(object sender,
System.Windows.Forms.PaintEventArgs e) {
LinearGradientBrush brush = new LinearGradientBrush(
this.ClientRectangle, Color.Black, Color.Blue,
LinearGradientMode.Vertical);
e.Graphics.FillRectangle(brush, this.ClientRectangle);
}
Am I going to have to override the Paint event for the Label components
as well and manually output the text?
--
Cheers,
David Clegg
dclegg_at_ebetonline_dot_com
"Where's the 'Any' Key?" - Homer Simpson