Using the Built-in Dialog Boxes

Windows Presentation Foundation User's Guide > Howto: Work With Files

The easiest way to load and save files with Text Control is to use the Load and Save methods without a parameter, as shown in Creating a simple WPF Application with Visual Studio .NET. This way, only a single line of code is required to open a file dialog box, fill its Files of type: combo box with supported file formats, and finally load and display a file the user has selected:

You may have noticed, though, that Load and Save actually consist of 11 overloaded functions each, and thus enable you to customize TX Text Control's file handling for various types of application. You can, for instance, load data from a string instead of a file, or provide your own customized dialog box. The next sections shows you some of the options available.