在VB.NET中设置文件大小 [英] Setting papersize in VB.NET

查看:63
本文介绍了在VB.NET中设置文件大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我参与了一个在vb.net中设计的项目并且运行良好。我使用下面的代码打印,但我需要增加我的纸张,因为我的条目增加了。所以我需要让我的文件更广泛。请谁帮帮我。

谢谢



Dim printDialog1 As PrintDialog = New PrintDialog

PrintDocument1.DefaultPageSettings .Landscape = True

PrintDocument1.DefaultPageSettings.PaperSize = PrintDocument1.PrinterSettings.PaperSizes(1)

PrintPreviewDialog1.ShowDialog()

Dim result As DialogResult = printDialog1.ShowDialog

If(result = Windows.Forms.DialogResult.OK)那么

PrintDocument1.Print()

结束如果< br $> b $ b

我尝试过:



昏暗printDialog1 As PrintDialog = New PrintDialog 
PrintDocument1.DefaultPageSettings.Landscape = True
PrintDocument1.DefaultPageSettings.PaperSize = PrintDocument1.PrinterSettings.PaperSizes(1)
PrintPreviewDialog1.ShowDialog()
昏暗的结果作为DialogResult = printDialog 1.ShowDialog
If(result = Windows.Forms.DialogResult.OK)然后
PrintDocument1.Print()
结束如果

解决方案

您可以尝试:

 PrintDocument1.DefaultPageSettings.PaperSize =  System.Drawing.Printing.PaperSize(  纸张尺寸名称,paperWidth,paperHeight)



参考:

打印文档 - 设置纸张尺寸和可打印区域| Microsoft [ ^ ]

PaperSize类| Microsoft [ ^ ]


I have worked on a project desinged in vb.net and it is working well. i am using the code below to print but i need to increase my papersize becuase my entries has increased. so i need to make my papersize to be wider. Please who can help me out.
Thanks

Dim printDialog1 As PrintDialog = New PrintDialog
PrintDocument1.DefaultPageSettings.Landscape = True
PrintDocument1.DefaultPageSettings.PaperSize = PrintDocument1.PrinterSettings.PaperSizes(1)
PrintPreviewDialog1.ShowDialog()
Dim result As DialogResult = printDialog1.ShowDialog
If (result = Windows.Forms.DialogResult.OK) Then
PrintDocument1.Print()
End If

What I have tried:

Dim printDialog1 As PrintDialog = New PrintDialog
            PrintDocument1.DefaultPageSettings.Landscape = True
        PrintDocument1.DefaultPageSettings.PaperSize = PrintDocument1.PrinterSettings.PaperSizes(1)
            PrintPreviewDialog1.ShowDialog()
            Dim result As DialogResult = printDialog1.ShowDialog
            If (result = Windows.Forms.DialogResult.OK) Then
                PrintDocument1.Print()
            End If

解决方案

You can try:

PrintDocument1.DefaultPageSettings.PaperSize = New System.Drawing.Printing.PaperSize("Paper Size Name", paperWidth, paperHeight)


Reference:
Print document - setting paper size and printable area | Microsoft[^]
PaperSize Class | Microsoft[^]


这篇关于在VB.NET中设置文件大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆