160 likes | 614 Vues
Common Dialog Control. The Common Dialog Control!!!. You want your user to set property or provide your application with some information easily? How do you do it?. Example. You want to prompt the user to open a file? How?
E N D
The Common Dialog Control!!! You want your user to set property or provide your application with some information easily? How do you do it?
Example You want to prompt the user to open a file? How? You could use the File List Box control, the Drive List Control, the Directory List Box control working together, responding to events… It would require coding… OR We could use the Common Dialog Control and write three lines of code…
What does the Common Dialog Control do? The Common Dialog control encapsulates functions for dealing with Files Printer Colors Font Help
What is the Common Dialog Control? The common dialog control is an OCX that encapsulates the common dialog API calls built into the Windows Operating system.
How Do I add the Common Dialog Control ? From the Project Menu – Choose Components From the Components Dialog choose the option Microsoft Common Dialog Control.
Why Use the Common Dialog Control? These are common tasks that a user does all the time! The User sees these common dialogs all the time! The advantage here from the user’s point of view is that they already know how to use the dialogs. They don’t have to learn something new. LET’S LOOK AT THESE DIALOGS ONE AT A TIME….
File Dialogs Input Properties: .InitDir – The initial directory folder .Filter - This property uses the “Prompt” – “Pattern” separated by the “|” character DEMO
Font Dialog The Font dialog box allows the user to select a font by its size, color, and style. DEMO
Color Dialog • The Color dialog box allows the user to select a color from a palette or to create and select a custom color. At run time, when the user chooses a color and closes the dialog box, you use the Color property to get the selected color DEMO
Printer Dialog The Print dialog box allows the user to specify how output should be printed. The user can specify a range of pages to be printed, a print quality, a number of copies, and so on. This dialog box also displays information about the currently installed printer and allows the user to configure or reinstall a new default printer. Note: This dialog box does not actually send data to a printer. It allows users to specify how they want data printed. You must write code to print the data in the format they select. DEMO
Help Dialog The Help dialog uses the older help file format. It requires the file format of .HLP. It is not really used now. The new format for help files is the compiled HTML format or CHM which can be displayed using the HTML Help API. DEMO
Conclusion The Common Dialog Control is useful control. It is easy to use and can sometimes save you some keystrokes.