Public Class Form1の全コード
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If PrintDialog1.ShowDialog() Then
PrintForm1.PrinterSettings = PrintDialog1.PrinterSettings
PrintForm1.PrinterSettings.DefaultPageSettings.Margins.Bottom = 10
PrintForm1.PrinterSettings.DefaultPageSettings.Margins.Left = 10
PrintForm1.PrinterSettings.DefaultPageSettings.Margins.Right = 10
PrintForm1.PrinterSettings.DefaultPageSettings.Margins.Top = 10
PrintForm1.Print(Me, PowerPacks.Printing.PrintForm.PrintOption.Scrollable)
End If
End Sub
End Class