Hi Kevin,
The problem seems in your Paint event handler,
as you may hear about the transparency of label control is simulated by
repainting the parent control, so in frmAbout_Paint event handler you need
always use the Graphics object passed by PaintEventargs, since the Graphics
created by this.CreateGraphics is associated with the parent control which
has no effect on painting the label control. And the Rectangle in the
LinearGradientBrush constructor should use Form.ClientRectangle to make the
gradient consistent with the background.
Here is a revised version of the event handler, you may test it to see if
it works on your form.
<code>
Private Sub frmAbout_Paint(ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
Dim b As New Drawing.Drawing2D.LinearGradientBrush(e.ClipRectangle, _
Color.AliceBlue, Color.DimGray,
LinearGradientMode.Vertical)
'I didn't see an overload definition could accept InterpolationMode, change
it
'to LinearGradientMode to make it compile though
'Drawing.Drawing2D.InterpolationMode.HighQualityBilinear)
e.Graphics.FillRectangle(b, e.ClipRectangle)
End Sub
</code>
Good Luck!
Best regards,
Ying-Shen Yu [MSFT]
Microsoft Community Support
Get Secure! -
www.microsoft.com/security
This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.