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.

vcShowFiles@

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

vcShowFilesDialog@

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

vcShowPrintDialog@

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

vcShowFontDialog@

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.

vcChooseFont@

Combines vcShowFontDialog@ with vcSetControlFont@.

vcShowColourDialog@

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

vcChooseColour@

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

Some of the standard callbacks also use common dialogs.

 

 

Basket
Empty
 
Copyright © 1999-2024 Silverfrost Limited