'*************************************** ' Private Global Properties/Variables/Objects '*************************************** Private WithEvents _MDIClient As MdiClient Private Sub frmMain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load '************************************************************************ ' Procedure/Function: frmMain_Load() ' Author: Ben Santiago ' Last Revision: 04/05/2006 ' Description: ' Initialize form. '************************************************************************ '*************************************** ' Find MDI Client Area At Load '*************************************** For Each objControl As Control In Me.Controls If TypeOf objControl Is MdiClient Then Me._MDIClient = objControl Exit For End If Next End Sub Private Sub _MDIClient_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles _MDIClient.Paint '************************************************************************ ' Procedure/Function: _MDIClient_Paint() ' Author: Ben Santiago ' Created On: 11/28/2006 ' Description: ' Draw MDI Parent background. '************************************************************************ Me.DrawBackground(e.Graphics) End Sub Private Sub _MDIClient_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles _MDIClient.Resize '************************************************************************ ' Procedure/Function: _MDIClient_Resize() ' Author: Ben Santiago ' Created On: 11/28/2006 ' Description: ' Draw MDI Parent background. '************************************************************************ Me.DrawBackground(Me._MDIClient.CreateGraphics()) End Sub Private Sub DrawBackground(ByVal objCanvas As Graphics) '************************************************************************ ' Procedure/Function: DrawBackground() ' Author: Ben Santiago ' Created On: 11/28/2006 ' Description: ' Draw the gradient background for the MDI Parent form. '************************************************************************ '*************************************** ' 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 '*************************************** objCanvas.Clear(Me._MDIClient.BackColor) objCanvas.FillRectangle(brushBlueGradient, New Rectangle(0, 0, Me.ClientSize.Width, Me.ClientSize.Height)) End Sub