I have seen many examples on pscode.com , that have messed up
Common Dialogs , mainly when it comes to the font dialog. This tutorial should teach you all you need to know for commondialogs.
Flags - These are simply options or choices you can use.
Using the flags:
'Setting it for use
CommonDialog.Flags = &H1
'Setting it for use of more than oneCommonDialog.Flags = &H1 Or &H4
This is simply the code to start up each dialog box.
CommonDialog.ShowColor 'Lets the user pick a color
CommonDialog.ShowFont 'Lets the user pick fontCommonDialog.ShowOpen 'Lets the user pick a file to open
CommonDialog.ShowPrinter 'Shows Printer Setup
CommonDialog.ShowSave 'Lets the user pick a file to save to
The following aresome flags for using the Color dialog boxes.
&H1 - This is one i personally like. This makes the common dialog start showing its current color.
&H2 - This starts with the custom color tab open.&H4 - This makes it so they can not create custom colors.
&H8 - This adds a help button to the dialog.
&H10 - This will reset the common dialog to default.
The following are some flagsfor using the Font dialog boxes.
&H1 - Allows the dialog only to list fonts supported by the system.
&H2 - Allows the dialog only to list fonts supported by the printer.
&H3 - Lists the fontsfrom the two above.
&H4 - Adds a help button.
&H100 - Allows the choices of underline strike thru and color selection.
&H2000 - Shows only font sizes between the min and max.
&H20000 - Allows onlyfonts that can be scaled.
&H40000 - Allows only true type fonts
Applying to a textbox - For each property you must set it here is an example
that sets it assuming you have &H100 and have a textboxnamed Text1
Text1.FontName = CommonDialog.FontName
Text1.FontItalic = CommonDialog.FontItalic
Text1.FontBold = CommonDialog.FontBold
Text1.FontStrikethru = CommonDialog.FontStrikethru...