The Common Dialog
control in ATEasy gives you the ability to present the user with various Windows Standard dialogs such as File Open, File Save and more. To display these dialogs you must place the common dialog control on a form and then use the control various methods to open the specific dialog you are interested in. The form is used only as a placeholder to host the common dialog control and at run-time its is not displayed.
Once dragged to a form at design-time the common dialog control will be displayed as shown here:
. By default the control name which will be used is: cdlg.
You can set the common dialog control initial properties from the control properties window. Select the appropriate tab dialog from Properties Window and change the options as desired.
To show the dialog box at run-time call the appropriate method as explained below for each dialog type:
Launches File Open dialog and returns the name of a file selected by the user:
Use the ShowOpen method to show the dialog. After the dialog is closed by the user you can retrieve the selected file name by using the FileName property.
Launches File Save dialog and returns the name of an existing or new file selected or created by the user.
Use the ShowSaveAs method to show the dialog. After the dialog is closed by the user you can retrieve the selected file name by using the FileName property.
Displays Color selection dialog and returns the value of a color as selected by the user. The user may select from a predefined windows colors or a customize color.
Use the ShowColor method to show the dialog. After the dialog is closed by the user you can retrieve the selected file name by using the Color property.
Displays the Font selection dialog and returns the font properties as selected by the user. The user may select the font name, size and other font attributes such as italic, bold and more.
Use the ShowFont method to show the dialog. After the dialog is closed by the user you can retrieve the selected file name by using the control font properties (FontName, FontSize, FontOptions and more). You may also use the Font property to get the selected AFont object.
Displays the Print dialog and returns printing parameters. The user may select the printer, # of copies, from page to page , print selection and more.
Note: At present, ATEasy does not support printing using the parameters set in the Print Dialog. The Print dialog returns a handle to the current printer device context hDC. You can use this handle using low-level Windows API to print to that printer.
Open the help viewer with a selected help file, topic and command. Possible command are to show the help file contents, to show a specific topic to search for a topic and to show a topic in a small Popup window (WhatsThisHelp mode).
Use the ShowHelp method to show the help viewer topic. The control supports two types of help file: Windows Help (.hlp) and Microsoft Compiled HTML Help file (.chm).
To create your own help file you might use a third-party help authoring software package such Microsoft Help Workshop, eHelp (BlueSky) RoboHelp or RoboHTML and more.