Global Const PRF_CLIENT = &H4& Global Const PRF_CHILDREN = &H10&
Global Const PRF_OWNED = &H20&
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Place a picturebox somewhere on your form. Name it "FormPicture". Set its Visible property to False, AutoRedraw to True, and BorderStyle to None.
Then, in the module that is to do the printing, put this code:
OK, this prints your form and ( most of ) it's controls to the page.
This is essentially what "PrintForm" does, but this allows you to specify *where* on the page your form will be printed, and how many times you want to print it on the page ( before issuing the Printer.EndDoc command )
By modifying the line:
Printer.PaintPicture FormPicture.Picture, 0, 0
We specify the place on the page the form will be printed. the last two numbers in that line are Single values that specify the X and Y position on the printer page, for the Top / Left corner of your form. ( look up PaintPicture on MSDN for more on what this command can do )
By looping through the print commands 3 times, changing the position of your form to print out each time, then giving the Printer.EndDoc command, you get the required 3 times per page.
Note: Some controls will not print their contents with this code as is. Most of the standard ones will, but the Picturebox will not. If you have any Pictureboxes on your form, Set your forms AutoRedraw to True, and transfer their images to the form like this: ( This also applies to FlexGrids. )
THOMASNG: You need to start reading the questions a little slower...and a little more careful, and see the responses already made. You are throwing too much confusion into the subjects.
This question was pretty clear:
"I'd like to print the same form 3 times per page,..."
That means:
"I'd like to print the same form 3 times per page" [/i][/u]******************************************************* General remarks:
If this post contains any suggestions for the use or distribution of code, components or files of any sort, it is still your responsibility to assure that you have the proper license and distribution rights to do so!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.