Disregard, I figured it out! Thanks.
' Printing a paycheck.
Imports System.Drawing.Printing
Imports System.Drawing.Imaging
Public Class CheckWriter
' PrintPage event raised for each page to be printed
Private graphicsObject As Graphics
Private imageValue As Image
' display the wood preview
Private Sub woodRadioButton_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles woodRadioButton.CheckedChanged
PictureBox1.Image = My.Resources.wood
End Sub
' display the brick preview
Private Sub brickRadioButton_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles brickRadioButton.CheckedChanged
PictureBox1.Image = My.Resources.bricks
End Sub
Private Sub printDocument_PrintPage(ByVal sender As System.Object,
ByVal e As System.Drawing.Printing.PrintPageEventArgs) _
Handles printDocument.PrintPage
Dim fontObject As Font ' variable to store the font
' store a control's x- and y-coordinates
Dim yPosition As Integer
Dim xPosition As Integer
' represent the left margin of the page
Dim leftMargin As Integer = e.MarginBounds.Left
' represent the top margin of the page
Dim topMargin As Integer = e.MarginBounds.Top
' store a control's text
Dim controlText As String = Nothing
e.Graphics.DrawImage(PictureBox1.Image, leftMargin, topMargin, Me.Width, Me.Height - 60)
' iterate over the controls on the Form,
' printing the text displayed in each control
For Each controlObject In Me.Controls
' do not print Buttons
If Not (TypeOf controlObject Is Button) Then
controlText = controlObject.Text
Select Case controlObject.Name
Case "dateTimePicker" ' underline the date
fontObject = New Font("Segoe UI", 9.0F,
FontStyle.Underline)
Case "amountTextBox" ' draw a box around the amount
e.Graphics.DrawRectangle(Pens.Black,
amountTextBox.Location.X + leftMargin,
amountTextBox.Location.Y + topMargin - 2,
amountTextBox.Width, amountTextBox.Height)
fontObject = controlObject.Font ' default font
Case Else
fontObject = controlObject.Font ' default font
End Select
' set the …