Microsoft KB Archive/93015

= PRB: Invalid Screen Mode Error Occurs with PrintForm Method =

PSS ID Number: 93015

Article Last Modified on 1/9/2003

-

The information in this article applies to:


 * Microsoft Visual Basic for MS-DOS 1.0

-



This article was previously published under Q93015



SYMPTOMS
Attempting to use the PrintForm method on a form that is not displayed results in an &quot;Invalid Screen Mode&quot; error message.



CAUSE
The VBDOS.EXE interpreter environment requires that the form be shown prior to performing the PrintForm method.



WORKAROUND
To prevent this error from occurring, you must show Form1 first, with the Show property. Then you can proceed with the PrintForm method.



STATUS
This behavior is by design.



Steps to Reproduce Behavior
 Start VBDOS.EXE. Choose New Form... from the File Menu (Form1.FRM). Save the file and exit FD.EXE.  Add the following code to Form1's Form_Click event procedure: SUB Form_Click SCREEN.HIDE PRINTER.PRINTTARGET = &quot;print.out&quot; Form1.PRINTFORM SCREEN.SHOW END SUB  Press the F5 key to run the program. An &quot;Invalid Screen Mode&quot; error message is returned.</li></ol>

Additional query words: VBmsdos 1.00

Keywords: kbprb KB93015

Technology: kbAudDeveloper kbVB100DOS kbVBSearch kbZNotKeyword3

-

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

© 2004 Microsoft Corporation. All rights reserved.