Common dialogs

Common dialogs are used to select files for "Open" and for "Save As". They are also used for printing, for selecting a font and for choosing a colour.

Solution9 in the Visual ClearWin demonstration pack illustrates common dialogs.

In the Visual Studio form design view, select the common dialog that you want from the Toolbox. In the case of PrintDialog, PrintPreviewDialog and PageSetupDialog, you must also attach a PrintDocument component.

The following methods can be used to open common dialogs.


Opens a common Open or SaveAs dialog and reads a list of files into an array of character strings.


Opens a common Open or SaveAs dialog and passes the file names to a specified callback function.


Opens a Print, PrintPreview or PageSetup dialog. A prior call to vcOnPrintPage@ specifies a callback that prints each page in turn.


Opens the Font dialog and keeps the result in its own properties. A subsequent call to vcSetControlFont@, for example, uses the result to change the font of a control.


Combines vcShowFontDialog@ with vcSetControlFont@.


Opens a colour dialog using a colour value as both input and output.


Opens a colour dialog and sets the foreground colour of a specified control.

Some of the standard callbacks also use common dialogs.



Copyright © 1999-2024 Silverfrost Limited