当前位置: 首页>>代码示例>>VB.NET>>正文


VB.NET PageSetupDialog.PrinterSettings属性代码示例

本文整理汇总了VB.NET中System.Windows.Forms.PageSetupDialog.PrinterSettings属性的典型用法代码示例。如果您正苦于以下问题:VB.NET PageSetupDialog.PrinterSettings属性的具体用法?VB.NET PageSetupDialog.PrinterSettings怎么用?VB.NET PageSetupDialog.PrinterSettings使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在System.Windows.Forms.PageSetupDialog的用法示例。


在下文中一共展示了PageSetupDialog.PrinterSettings属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。

示例1: If

'This method displays a PageSetupDialog object. If the
' user clicks OK in the dialog, selected results of
' the dialog are displayed in ListBox1.
Private Sub Button1_Click(ByVal sender As System.Object, _
    ByVal e As System.EventArgs) Handles Button1.Click

    ' Initialize the dialog's PrinterSettings property to hold user
    ' defined printer settings.
    PageSetupDialog1.PageSettings = _
        New System.Drawing.Printing.PageSettings

    ' Initialize dialog's PrinterSettings property to hold user
    ' set printer settings.
    PageSetupDialog1.PrinterSettings = _
        New System.Drawing.Printing.PrinterSettings

    'Do not show the network in the printer dialog.
    PageSetupDialog1.ShowNetwork = False

    'Show the dialog storing the result.
    Dim result As DialogResult = PageSetupDialog1.ShowDialog()

    ' If the result is OK, display selected settings in
    ' ListBox1. These values can be used when printing the
    ' document.
    If (result = DialogResult.OK) Then
        Dim results() As Object = New Object() _
            {PageSetupDialog1.PageSettings.Margins, _
             PageSetupDialog1.PageSettings.PaperSize, _
             PageSetupDialog1.PageSettings.Landscape, _
             PageSetupDialog1.PrinterSettings.PrinterName, _
             PageSetupDialog1.PrinterSettings.PrintRange}
        ListBox1.Items.AddRange(results)
    End If

End Sub
开发者ID:VB.NET开发者,项目名称:System.Windows.Forms,代码行数:36,代码来源:PageSetupDialog.PrinterSettings

示例2: PageSetupDialogSettings

' 导入命名空间
Imports System.IO
Imports System.Windows.Forms

public class PageSetupDialogSettings
   public Shared Sub Main
        Dim PageDB As New PageSetupDialog()

        PageDB.Document = New System.Drawing.Printing.PrintDocument()

        If (PageDB.ShowDialog() = DialogResult.OK) Then
            Console.WriteLine("Allow Margins: " & PageDB.AllowMargins)
            Console.WriteLine("Allow Orientation: " & PageDB.AllowOrientation)
            Console.WriteLine("Allow Paper: " & PageDB.AllowPaper)
            Console.WriteLine("Allow Printer: " & PageDB.AllowPrinter)
            Console.WriteLine("Minimum Margins: " & PageDB.MinMargins.ToString())
            Console.WriteLine("Show Network: " & PageDB.ShowNetwork)
            Console.WriteLine("Printer Settings: " & PageDB.PrinterSettings.ToString())
        End If
   End Sub
End class
开发者ID:VB程序员,项目名称:System.Windows.Forms,代码行数:21,代码来源:PageSetupDialog.PrinterSettings


注:本文中的System.Windows.Forms.PageSetupDialog.PrinterSettings属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。