PrintForm Forum only!!

I've no backexperience on VB6 but more than three years of experience on .net. I'm trying now to play with the printer.

PrintForm look to be a very useful utility; only few programming examples are missing.

Pls open a specific forum per Power Pack tool.



Answer this question

PrintForm Forum only!!

  • Alex-MyRpg

    I want to print a form using the PrintForm utility. It works fine but there is an important detail I can't manage which did work in VB6.

    Specifically, when I push the button that invokes PrintForm I want to change the background colors of all the labels and the form itself so that the printer is only doing black and white (the form as originally displayed has colors). This operation takes place in a Command Box brought over from a VB6 conversion. This is a simplified version

    Command1_Click

    'change colors to black or white

    label1.backcolor= color.black

    label2.backcolor=color.white

    me.backcolor=color.white

    PrintForm1()

    label1.backcolor=color.RoyalBlue 'original color of the display

    label2.backcolor=color.Gainsboro

    me.backcolor = color.Gainsboro

    End Sub

    But this does not work. The form prints as it was on the screen when the Command box was clicked. Any ideas how to accomplish this

    Interestingly, if I create a button containing the PrintForm1 command , change the background color of the form in the command button and then give the button the focus out of the command box, then the form will print out white but none of labels will have changed from the original form. See below

    Command1_Click

    label1.backcolor= color.black

    label2.backcolor=color.white

    me.backcolor=color.white

    button1.visible=true

    button1.focus

    endsub

    Button1_Enter

    PrintForm1()

    endsub

    Thanks


  • bryanedds

    You were right. Everything works fine now.

    Thanks


  • PiaMaria

    I believe this is just a timing issue.

    If you call me.Refresh() after changing the backcolor it will solve the problem. Also the PrintForm component contains two methods of capturing the form. I found it I used this override it works fine also:

    PrintForm1.Print(Me, PowerPacks.Printing.PrintForm.PrintOption.ClientAreaOnly)



  • msaeedf

    Many thanks! Not seen that there was and help document and a sample project installed on my Pc.

    ----

    Btw: may be you do not know. In Australia there is a company i.e. John Hart exactly with your name!


  • jhidey

    Hi all:

    I want printing form this printfomr1 component but no print quickly to my paper.

    my paper size is width:8cmxheigh:14 or label size. whhat do you do for print this paper or label

    my printer is HP laserjet 1320

    thanks for resolve this peoblem


  • AfCo

    Feel free to ask your PrintForm questions in this forum.

    The help document and sample project should be installed to your Program Files\Microsoft Visual Basic 2005 Power Packs\Printing\PrintForm Component 1.0.

    Keep in mind this component is just designed to print the image of Windows Form and may not meet all of your printing needs. For that you should look into PrintDocuments:

    http://msdn.microsoft.com/library/default.asp url=/library/en-us/cpref/html/frlrfsystemdrawingprintingprintdocumentclasstopic.asp



  • PrintForm Forum only!!