Display Print dialog and get settings : Print Dialog « GUI « VB.Net Tutorial

Home
VB.Net Tutorial
1.Language Basics
2.Data Type
3.Operator
4.Statements
5.Date Time
6.Class Module
7.Development
8.Collections
9.Generics
10.Attributes
11.Event
12.LINQ
13.Stream File
14.GUI
15.GUI Applications
16.Windows Presentation Foundation
17.2D Graphics
18.I18N Internationlization
19.Reflection
20.Regular Expressions
21.Security
22.Socket Network
23.Thread
24.Windows
25.XML
26.Database ADO.net
27.Design Patterns
VB.Net
VB.Net by API
VB.Net Tutorial » GUI » Print Dialog 
14.64.2.Display Print dialog and get settings
Imports System.IO
Imports System.Windows.Forms

public class PageSetupDialogSettings
   public Shared Sub Main
        Dim PrintDB As New PrintDialog()
        PrintDB.Document = New System.Drawing.Printing.PrintDocument()

        If (PrintDB.ShowDialog() = DialogResult.OKThen
            Console.WriteLine("Printer: " & PrintDB.PrinterSettings.PrinterName)
            Console.WriteLine("From Page: " & PrintDB.PrinterSettings.FromPage)
            Console.WriteLine("To Page: " & PrintDB.PrinterSettings.ToPage)
            Console.WriteLine("Print Range: " & PrintDB.PrinterSettings.PrintRange)
            Console.WriteLine("Copies: " & PrintDB.PrinterSettings.Copies)

            If (PrintDB.PrinterSettings.LandscapeAngle = 90Then
                Console.WriteLine("Landscape")
            Else
                Console.WriteLine("Portrait")

            End If
            Console.WriteLine("Allow Print to File: " & PrintDB.AllowPrintToFile)
            Console.WriteLine("AllowSelection: " & PrintDB.AllowSelection)
            Console.WriteLine("Allow Some Pages: " & PrintDB.AllowSomePages)
            Console.WriteLine("Print to File: " & PrintDB.PrintToFile)
            Console.WriteLine("Show Network: " & PrintDB.ShowNetwork)
        End If
   End Sub
End class
14.64.Print Dialog
14.64.1.PrintSettings for a Print dialogPrintSettings for a Print dialog
14.64.2.Display Print dialog and get settings
14.64.3.Has more pagesHas more pages
14.64.4.Print three pages out
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.