本文整理匯總了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
示例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