Using Common Dialogs

In WPF 4 common dialogs are wrappers of Win32 dialogs. They are exposed by the Microsoft.Win32 namespace and are OpenFileDialog and SaveFileDialog. (WPF also provides a PrintDialog control exposed by the System.Windows.Controls namespace.) The following code demonstrates how you instantiate both dialogs:

image

Notice that the ShowDialog method returns a Nullable(Of Boolean) where True means that the user clicks OK, False when she clicks Cancel, and Nothing when she closes the dialog.

Summary

In this chapter you took an overview of WPF’s most common used controls that you can use in your client applications, understanding how ...

Get Visual Basic® 2010 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.