Henry,
In addition to the other comments.
I've set the BackgroundImage of the from to an image that was painted with a
gradient brush, something like:
Protected Overrides Sub OnLayout(ByVal e As LayoutEventArgs)
MyBase.OnLayout(e)
If Not Me.BackgroundImage Is Nothing Then
If Size.op_Equality(Me.BackgroundImage.Size, Me.ClientSize) Then
Exit Sub
End If
Me.BackgroundImage.Dispose()
Me.BackgroundImage = Nothing
End If
Dim rect As New Rectangle(New Point(0, 0), Me.ClientSize)
Dim image As New Bitmap(Me.ClientSize.Width, Me.ClientSize.Height)
Dim gr As Graphics = Graphics.FromImage(image)
Dim brush As New LinearGradientBrush(rect,
ControlPaint.LightLight(Me.BackColor), Me.BackColor,
LinearGradientMode.Vertical)
brush.SetBlendTriangularShape(2 / 3)
gr.FillRectangle(brush, rect)
gr.Dispose()
brush.Dispose()
Me.BackgroundImage = image
End Sub
Hope this helps
Jay
| How does one create a gradient background for a form?
|
|