Public Class frmHR

  Const ONE_INCH As Integer = 100     'number of points in an inch
  Const LINE_HEIGHT As Integer = 20   'one quarter of an inch

  Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrint.Click
    PrintDocument1.Print()
  End Sub

  Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
    Dim gr As Graphics = e.Graphics
    Dim x1 As Integer = ONE_INCH         'use one inch beyond left margin
    Dim x2 As Integer = 3 * ONE_INCH     'offset for second column
    Dim y As Integer = ONE_INCH          'use one inch top margin
    Dim font As New Font("Courier New", 10, FontStyle.Bold)
    gr.DrawString("PLAYER", font, Brushes.Blue, x1, y)
    gr.DrawString("HR", font, Brushes.Blue, x2, y)
    font = New Font("Courier New", 10, FontStyle.Regular)
    y += LINE_HEIGHT
    gr.DrawString("Barry Bonds", font, Brushes.Black, x1, y)
    gr.DrawString("762", font, Brushes.Black, x2, y)
    y += LINE_HEIGHT
    gr.DrawString("Hank Aaron", font, Brushes.Black, x1, y)
    gr.DrawString("755", font, Brushes.Black, x2, y)
    y += LINE_HEIGHT
    gr.DrawString("Babe Ruth", font, Brushes.Black, x1, y)
    gr.DrawString("714", font, Brushes.Black, x2, y)
  End Sub

  Private Sub btnPreview_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPreview.Click
    PrintPreviewDialog1.Document = PrintDocument1
    PrintPreviewDialog1.ShowDialog()
  End Sub

  Private Sub PrintPreviewDialog1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PrintPreviewDialog1.Load

  End Sub
End Class
