locked
Visual basic powerpack printform RRS feed

  • Question

  • I've set up a button on a form with code PrintForm1.Print().  A portion of the form prints nicely, but it prints in portrait mode and does not show the whole form.  I am looking for code to include to capture the whole form and print it in landscape.



    Jim Foy

    Wednesday, December 27, 2017 8:21 PM

All replies

    • Proposed as answer by IronRazerz Wednesday, December 27, 2017 11:55 PM
    Wednesday, December 27, 2017 11:07 PM
  •  I agree,  ditch the old vb power packs all together.  Use the .Net Control.DrawToBitmap Method to draw the form to a Bitmap and then you can scale and/or flip the form image however you want before printing it with a PrintDocument Class control.  Tom and I both showed ways of doing that in the link he provided.

     There are also ways to modify the code if you only want to print the Client area of the Form without the borders and top caption area too.


    If you say it can`t be done then i`ll try it

    • Edited by IronRazerz Thursday, December 28, 2017 12:15 AM
    Thursday, December 28, 2017 12:13 AM
  • Thanks for both your responses.  I'll have time to look at this over the weekend and will get back with you on results.

    Jim


    Jim Foy

    Friday, December 29, 2017 7:31 PM
  • Thanks for the response.  It looks like what I need.  Will be looking at this on weekend and will get back to you on results.

    Jim


    Jim Foy

    Friday, December 29, 2017 7:33 PM
  • So, it took a few months to get back on this.  

    I'm happy to report that the code worked like a charm and I'm belatedly thanking you for your assistance.

    It's definitely a better solution than the power pack.

    Again...THANKS!!


    Jim Foy

    Wednesday, March 21, 2018 12:27 AM
  • Thanks for both your responses.  I'll have time to look at this over the weekend and will get back with you on results.

    Jim


    Jim Foy

    Yes Visual Basic PowerPacks although available are no longer supported. Plus if you install the app on a different PC you either have to install power packs with it or have the app when compiled locally write the necessary .Dlls so the installer provided for the app copies those .Dlls with the executable to the new executables location on the PC to be installed on.

    No matter what in power packs is being used there are other methods for performing the same thing in .Net typically.

    I wonder if I live south of the Cheddar Curtain or maybe on the equator of the Cheddar Curtain or if I'm in the Cheddar Curtains neutral zone?

    Also please mark the post that answered your question as the answer. Thanks.


    La vida loca

    Wednesday, March 21, 2018 1:46 AM
  • There is North of the Cheddar Curtain and then there is everywhere else. 

    Thanks for the assistance.


    Jim Foy

    Wednesday, March 21, 2018 11:21 AM