Microsoft KB Archive/151080

= BUG: Printer Dialog Box Doesn't Show For Common Dialog Control =

Article ID: 151080

Article Last Modified on 6/28/2004

-

APPLIES TO


 * Microsoft Visual Basic 4.0 Standard Edition
 * Microsoft Visual Basic 4.0 Professional Edition
 * Microsoft Visual Basic 4.0 Professional Edition
 * Microsoft Visual Basic 4.0 16-bit Enterprise Edition
 * Microsoft Visual Basic 4.0 32-Bit Enterprise Edition

-



This article was previously published under Q151080



SYMPTOMS
If the Common Dialog control is used to invoke an Open dialog box, and if a file is selected from that Open dialog box, and then if the Printer dialog box is invoked using the same Common Dialog control, the Printer dialog does not appear.



RESOLUTION
To work around this behavior, reset the Flags property of the Common Dialog control to zero (0) after showing the Open dialog box.



STATUS
Microsoft has confirmed this to be an issue in the Microsoft products listed at the beginning of this article. Microsoft is researching this issue and will post new information here in the Microsoft Knowledge Base as it becomes available.



Steps To Reproduce Problem
 Start a new project. Form1 is created by default. Place a Common Dialog control and two Command buttons on the form.  In the Click event for Command1, place the following code: Private Sub Command1_Click CommonDialog1.filename = "*.mdb" CommonDialog1.ShowOpen End Sub

  In the Click event for Command2, place the following code: Private Sub Command2_Click CommonDialog1.ShowPrinter End Sub

 Run the project by pressing the F5 key. Click on the Command1 button to show the Open dialog box and select any MDB file (such as Biblio.mdb in the Visual Basic directory.) Then click on the Command2 button to show the Printer dialog box. Note that the Printer dialog box does not appear.</ol>

To implement the workaround, change the code in the Click event of the Command2 button to:

Private Sub Command2_Click CommonDialog1.Flags = 0 CommonDialog1.ShowPrinter End Sub

The Printer dialog box appears even after the Open dialog box has been displayed.

Additional query words: kbVBp400bug kbVBp kbdsd kbDSupport kbPrinting

Keywords: kbbug KB151080

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.