如何在Microsoft Visual Studio 2013中为项目添加打印按钮?

时间:2015-03-31 18:00:26

标签: vb.net visual-studio-2013

我在表单Form1上有一个按钮btnPrint,我希望在点击btnPrint时打印该表单。

1 个答案:

答案 0 :(得分:0)

从ToolBox

添加PrintForm工具

在打印按钮中......

  Try
        PrintForm1.Form.AutoSize = True
        PrintForm1.Form.AutoSizeMode = Windows.Forms.AutoSizeMode.GrowAndShrink
        PrintForm1.PrintAction = Printing.PrintAction.PrintToPreview
        PrintForm1.Print(Me, PowerPacks.Printing.PrintForm.PrintOption.Scrollable)
    Catch ex As Exception
    End Try