Steps through the common dialogs. Does nothing else useful : Print Dialog « GUI Windows Form « C# / C Sharp

Home
C# / C Sharp
1.2D Graphics
2.Class Interface
3.Collections Data Structure
4.Components
5.Data Types
6.Database ADO.net
7.Design Patterns
8.Development Class
9.Event
10.File Stream
11.Generics
12.GUI Windows Form
13.Language Basics
14.LINQ
15.Network
16.Office
17.Reflection
18.Regular Expressions
19.Security
20.Services Event
21.Thread
22.Web Services
23.Windows
24.Windows Presentation Foundation
25.XML
26.XML LINQ
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source
C# / C Sharp » GUI Windows Form » Print DialogScreenshots 
Steps through the common dialogs. Does nothing else useful
Steps through the common dialogs. Does nothing else useful

/*
C# Programming Tips & Techniques
by Charles Wright, Kris Jamsa

Publisher: Osborne/McGraw-Hill (December 28, 2001)
ISBN: 0072193794
*/

// CmnDlgs.cs -- steps through the common dialogs. Does nothing else useful.
//
//               Compile this program with the following command line:
//                   C:>csc CmnDlgs.cs
using System;
using System.Windows.Forms;
using System.Drawing.Printing;

namespace clsCommonDialogs
{
    public class CommonDialogs
    {
        [STAThread]
        static public void Main ()
        {
            // Create and display a Choose Color dialog box.
            ColorDialog cd = new ColorDialog ();
            cd.ShowDialog ();
            cd.Dispose ();
            
            // Create and display a Choose Font dialog box.
            FontDialog fd = new FontDialog ();
            fd.ShowDialog ();
            fd.Dispose ();
                
            // Create and display an Open File dialog box.
            OpenFileDialog ofd = new OpenFileDialog ();
            ofd.ShowDialog ();
            ofd.Dispose ();
            
            // Create and display a Save File dialog box.
            SaveFileDialog sfd = new SaveFileDialog();
            sfd.ShowDialog ();
            sfd.Dispose ();
            
            // Create and display a Page Setup dialog box.
            PrintDocument printDoc = new PrintDocument();
            PageSetupDialog psd = new PageSetupDialog ();
            psd.Document = printDoc;
            psd.ShowDialog ();
            psd.Dispose ();
            
            // Create and display an Print dialog box.
            PrintDialog pd = new PrintDialog ();
            pd.Document = printDoc;
            pd.ShowDialog ();
            pd.Dispose ();
            
            // Create and display an Print Preview File dialog box.
            // This dialog is not a part of the common dialog library.
            PrintPreviewDialog ppd = new PrintPreviewDialog ();
            ppd.ShowDialog ();
            ppd.Dispose ();
            printDoc.Dispose ();
        }
    }
}


           
       
Related examples in the same category
1.Using PrintPreviewDialog
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.