X
تبلیغات
پیکوفایل
رایتل

Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Resize

        MakeGradient()

    End Sub

 

    Private Sub Form1_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Activated

        MakeGradient()

    End Sub

 

    Private Sub MakeGradient()

        Dim objBrush As New Drawing2D.LinearGradientBrush(Me.DisplayRectangle, Color.Blue, Color.AliceBlue, Drawing2D.LinearGradientMode.Vertical)

 

        Dim objGraphics As Graphics = Me.CreateGraphics()

 

        objGraphics.FillRectangle(objBrush, Me.DisplayRectangle)

 

        objBrush.Dispose()

        objGraphics.Dispose()

    End Sub