How to Read Flag Property of VB Common Dialog Custom ControlsID: Q84068
|
The Flags property of a Common Dialog control can be read by examining
individual bit values of the Flag property and comparing them with
the predefined constant values in CONSTANT.TXT (or CONST2.TXT for
Visual Basic version 1.0 for Windows). This applies to the following
Visual Basic for Windows Common Dialogs:
The Flags property can be set at design time or run time.
To set the value of the Flags property, assign it a value. This is
most commonly done using a predefined constant (found in CONSTANT.TXT
or CONST2.TXT). For example, to set the PRINTTOFILE flag on the Print
Dialog box, use the following code:
CMDialog1.Flags = PD_PRINTTOFILE
CMDialog1.Flags = PD_PRINTTOFILE | PD_SHOWHELP
PD_PRINTTOFILE = 00000000000000000000000000100000
PD_SHOWHELP = 00000000000000000000100000000000
Flags = 00000000000000000000100000100000
Form1.Print (CMDialog1.Flags AND PD_PRINTTOFILE)
Flags = 00000000000000000000100000100000
AND
PD_PRINTTOFILE = 00000000000000000000000000100000
Result = 00000000000000000000000000100000
If (CMDialog1.Flags AND PD_PRINTTOFILE) Then
' Code for printing to file goes here.
Else
' Code for printing to printer goes here.
End If
Additional query words: 1.00 2.00 3.00
Keywords :
Version :
Platform :
Issue type :
Last Reviewed: June 10, 1999