Protected Overrides Sub OnPaint(e As PaintEventArgs) ' Call the OnPaint method of the base class. MyBase.OnPaint(e) ' Call methods of the System.Drawing.Graphics object. '*************************************** ' Initialize Variables '*************************************** Dim brushBlueGradient As LinearGradientBrush '*************************************** ' Default Values '*************************************** brushBlueGradient = New LinearGradientBrush(Me.ClientRectangle, _ Color.FromArgb(115, 160, 196), _ Color.FromArgb(194, 213, 224), _ LinearGradientMode.Vertical) '*************************************** ' Draw Main Gradient Area '*************************************** e.Graphics.FillRectangle(brushBlueGradient, New Rectangle(0, 0, Me.ClientSize.Width, Me.ClientSize.Height)) End Sub>I have the following code placed inside an MDI Parent Form's Paint method:
> Private Sub frmMain_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint > > '*************************************** > ' Initialize Variables > '*************************************** > Dim brushBlueGradient As LinearGradientBrush > > '*************************************** > ' Default Values > '*************************************** > brushBlueGradient = New LinearGradientBrush(Me.ClientRectangle, _ > Color.FromArgb(115, 160, 196), _ > Color.FromArgb(194, 213, 224), _ > LinearGradientMode.Vertical) > > '*************************************** > ' Draw Main Gradient Area > '*************************************** > e.Graphics.FillRectangle(brushBlueGradient, New Rectangle(0, 0, Me.ClientSize.Width, Me.ClientSize.Height)) > End Sub >>