Public Class Form23


    Private Sub Form23_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Me.客户TableAdapter.Fill(Me.NorthwindDataSet.客户)
        D1.DataSource = Me.NorthwindDataSet.客户

    End Sub

  

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim mydgvprint As New VBprinter.DGVprint()
        mydgvprint.MainTitle = "DGVPrint以自动换行的工资条打印方式打印DataGridView"
        mydgvprint.PrintType = VBprinter.DGVprint.mytype.GeneralPrint
        mydgvprint.ReportHeaderText = TextBox1.Text
        mydgvprint.ReportHeaderSpace = 30
        mydgvprint.ReportFooterText = TextBox2.Text
        mydgvprint.ReportFooterSpace = 20
        mydgvprint.ReportFooterFont = New Font("黑体", 19, FontStyle.Italic)
        mydgvprint.ReportFooterText = "这是打印完DGV后在尾部可以继续打印的内容，可以随便设置要打印的内容。"
        mydgvprint.ReportFooterSpace = 20 '
        mydgvprint.Print(D1, False)
        mydgvprint.Dispose()
        mydgvprint = Nothing
    End Sub


End Class