locked
hide "generating ..." on print previewing RRS feed

  • Question

  • is there any simple way to hide "generating .." while print previewing or printing document for VB Net ... thanks 4 d attention
    • Moved by Cindy Meister MVP Sunday, November 13, 2011 11:01 PM not vsto-related (From:Visual Studio Tools for Office)
    Friday, November 11, 2011 2:56 AM

Answers

  • Hi rachmat,

    Welcome to the MSDN forum.

    According to your description, you are looking for a method to hide the Generating Previews dialog when you use PrintPreviewControl and when it is printed. Here are the suggestions:

    The 'Generating Previews' dialog is shown while calculating the layout for pages in OnPaint().The way to avoid this dialog is to override the OnPaint method. You can create your own layout, and pass it to the PrintController. In this way, the base one will not be used.

    Use the StandardPrintController when you print directly to the printer. In this way, you will not get the Generating Previews dialog when you printing. But it will not work for the PrintPreviewControl.

    Here are solutions to similar questions as yours:
    http://social.msdn.microsoft.com/Forums/en-NZ/winforms/thread/2c16f8da-a679-4f9b-b15c-ef999a186135
    http://www.eggheadcafe.com/microsoft/Csharp/30043381/printpreviewcontrol--hide-generating-previews-dialog.aspx

    If you have any concerns, please feel free to let me know.


    Mark Liu-lxf [MSFT]
    MSDN Community Support | Feedback to us
    • Marked as answer by Mark Liu-lxf Friday, November 18, 2011 1:38 AM
    Monday, November 14, 2011 12:07 PM
  • There isn't any simple code to hide the form for preview.  It really shouldn't matter for preview, since the preview is for a user to observe.  Hiding the form when printing is easily implemented because it's not necessary to involve a user in the process.
    • Marked as answer by Mark Liu-lxf Friday, November 18, 2011 1:38 AM
    Monday, November 14, 2011 5:00 PM

All replies

  • Hi rachmat

    could you please specify the Office application, version of Office and version of VSTO involved in your question.


    Cindy Meister, VSTO/Word MVP
    Friday, November 11, 2011 7:50 AM
  • No, not office app .. it's just VB Net VS2005 ..

    Sunday, November 13, 2011 2:48 PM
  • Hi rachmat,

    Welcome to the MSDN forum.

    According to your description, you are looking for a method to hide the Generating Previews dialog when you use PrintPreviewControl and when it is printed. Here are the suggestions:

    The 'Generating Previews' dialog is shown while calculating the layout for pages in OnPaint().The way to avoid this dialog is to override the OnPaint method. You can create your own layout, and pass it to the PrintController. In this way, the base one will not be used.

    Use the StandardPrintController when you print directly to the printer. In this way, you will not get the Generating Previews dialog when you printing. But it will not work for the PrintPreviewControl.

    Here are solutions to similar questions as yours:
    http://social.msdn.microsoft.com/Forums/en-NZ/winforms/thread/2c16f8da-a679-4f9b-b15c-ef999a186135
    http://www.eggheadcafe.com/microsoft/Csharp/30043381/printpreviewcontrol--hide-generating-previews-dialog.aspx

    If you have any concerns, please feel free to let me know.


    Mark Liu-lxf [MSFT]
    MSDN Community Support | Feedback to us
    • Marked as answer by Mark Liu-lxf Friday, November 18, 2011 1:38 AM
    Monday, November 14, 2011 12:07 PM
  • Hi Mark,

    I'm a beginner and I've already visited those 2 links before .. but I couldn't get any simple code that tried to find ....

     

    Monday, November 14, 2011 4:17 PM
  • There isn't any simple code to hide the form for preview.  It really shouldn't matter for preview, since the preview is for a user to observe.  Hiding the form when printing is easily implemented because it's not necessary to involve a user in the process.
    • Marked as answer by Mark Liu-lxf Friday, November 18, 2011 1:38 AM
    Monday, November 14, 2011 5:00 PM