PRB: Invalid Screen Mode Error Occurs with PrintForm Method

ID: Q93015


The information in this article applies to:
  • Microsoft Visual Basic Standard and Professional Editions for MS-DOS, version 1.0


SYMPTOMS

Attempting to use the PrintForm method on a form that is not displayed results in an "Invalid Screen Mode" 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.


MORE INFORMATION

Steps to Reproduce Behavior

  1. Start VBDOS.EXE.


  2. Choose New Form... from the File Menu (Form1.FRM). Save the file and exit FD.EXE.


  3. Add the following code to Form1's Form_Click event procedure:
    
       SUB Form_Click
          SCREEN.HIDE
          PRINTER.PRINTTARGET = "print.out"
          Form1.PRINTFORM
          SCREEN.SHOW
       END SUB 


  4. Press the F5 key to run the program.


  5. An "Invalid Screen Mode" error message is returned.


Additional query words: VBmsdos 1.00

Keywords :
Version : MS-DOS:1.0
Platform : MS-DOS
Issue type :


Last Reviewed: December 10, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.