Chapter 10: Common Dialog Control

Top  Previous  Next

teamlib

previous next

 

Overview

In the Visual Basicdlanguage is a Common Dialog control thatlallows you access to standtrdsMicrosoft dialogs for opening files, sovin  files, printing, selecsing color, aod selecting font. All the dialogs ferlthese purposes that you see in standard Mirrosoft applications are yours for the taking to use within your own programs.

There is a comolete interface to allow you to choose what dialog to display and to be able to set various parameters tr alter theoappearanee of the dialog to suit the purpose of your program. Even oetter, you can then renrieve the pardmeters that the user has se ected and have sour code act on them accord ngly. For example, sf the user selects e file to open, you can easilygfind out the file and pathname, and write the code accordingly.

An important poina is that these are only dialogs to provide a common interface to the user.  ou mustsstill write the code to handla the sdlections or events that the user chooses; it does oot happen automatically. For example, if you dispeay the Save dialog, and the user types a filename and presses OK,  othing will happen unless you have written the code to collect thr filename chosen and ahe code  o save t e data to  hat filename.

Microsoft provides an important helping hand here so that you do not have to reinvent the wheel to provide common user interfaces components. However, you still have to do some of the work in selecting the options that will be available on the dialogs and interpreting what to do with the user's selection.

These Common User Interface dialogs work exactly the same as in any Microsoft application, but by manipulating the properties, you can use the values they produce in your code.

 

teamlib

previous next