當前位置: 首頁>>代碼示例>>VB.NET>>正文


VB.NET PageSetupDialog.ShowNetwork屬性代碼示例

本文整理匯總了VB.NET中System.Windows.Forms.PageSetupDialog.ShowNetwork屬性的典型用法代碼示例。如果您正苦於以下問題:VB.NET PageSetupDialog.ShowNetwork屬性的具體用法?VB.NET PageSetupDialog.ShowNetwork怎麽用?VB.NET PageSetupDialog.ShowNetwork使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在System.Windows.Forms.PageSetupDialog的用法示例。


在下文中一共展示了PageSetupDialog.ShowNetwork屬性的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.ShowNetwork

示例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.ShowNetwork


注:本文中的System.Windows.Forms.PageSetupDialog.ShowNetwork屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。