Chapter 16: Using Common Dialogs


Overview

The last three chapters looked at various aspects of programming Windows Forms applications, and how to implement such things as menus, toolbars, and SDI and MDI forms. Now you know how to display simple message boxes to get information from the user and how to create more sophisticated custom dialogs to ask the user for specific information. However, for common tasks such as opening and saving files, you can use prewritten dialog classes instead of having to create your own custom dialog.

This not only has the advantage of requiring less code, but also it uses the familiar Windows dialogs, giving your application a standard look and feel. the .NET Framework has classes that hook up to the Windows dialogs to open and create directories, to open and save files, to access printers, and to select colors and fonts.

In this chapter, you learn how to use these standard dialog classes. In particular, you will:

  • Use OpenFileDialog and SaveFileDialog classes

  • Learn about the .NET printing class hierarchy and use the the PrintDialog, PageSetupDialog, and PrintPreviewDialog classes to implement printing and print preview

  • Look at how to change fonts and colors with the FontDialog and ColorDialog classes

  • Use the FolderBrowserDialog class that is new with .NET 2.0




Beginning Visual C# 2005
Beginning Visual C#supAND#174;/sup 2005
ISBN: B000N7ETVG
EAN: N/A
Year: 2005
Pages: 278

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net