Imports System.Drawing.Printing Public Class Form1 Private Sub Form1_Shown(sender As Object, e As EventArgs) Handles Me.Shown PrintDocument1.Print() End Sub Private Sub PrintDocument1_PrintPage(sender As Object, e As Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage Dim rect As New Rectangle(20, 10, 200, 150) Dim gradientBrush As New Drawing2D.LinearGradientBrush(rect, Color.Blue, Color.Red, 0) e.Graphics.FillRectangle(gradientBrush, 20, 10, 200, 150) End Sub Private Sub PrintDocument1_EndPrint(sender As Object, e As PrintEventArgs) Handles PrintDocument1.EndPrint Me.Hide() End Sub End Class