printpreview在vb.net中无法正常显示

时间:2017-12-03 06:32:55

标签: vb.net print-preview

我有一个表单,单击打印预览按钮显示为表单的预览,但它显示为截图。因为它显示背景灰色背景和文本视图框也显示。 [在下面的预览中它看起来像截图,不想显示文本框只想显示值]

Private Sub Button4_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        PrintDialog1.Document = PrintDocument1
        PrintDialog1.PrinterSettings = PrintDocument1.PrinterSettings
        PrintDialog1.AllowSomePages = True
        If PrintDialog1.ShowDialog = DialogResult.OK Then
            PrintDocument1.PrinterSettings = PrintDialog1.PrinterSettings

            PrintDocument1.Print()
        End If
    End Sub

    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        PrintForm1.PrintAction = Printing.PrintAction.PrintToPreview

        Button4.Visible = False
        Button5.Visible = False
        Button1.Visible = False
        Button2.Visible = False
        PrintForm1.Print()

    End Sub

0 个答案:

没有答案