October 15th, 2009, 03:04 AM
Print a Form Preview Window with pictures
I have the following scenario:
I have built a form preview using scrollbar and picturebox. Within this picture box control, I have ten other picture boxs (let's call them cards). Each card has 4 labels and two image boxes. Yes. Imagine you are printing a series of ten ID badges. Each badge has a barcode and a picture plus names, etc.
The preview works. The problem is printing. I snatched some code from MSDN which uses SendMessage to grab the child content of a picture box. I was able to verify that each card is built correctly. I was able to use SavePicture to save each card as a bitmap and I was able to view th bitmaps.
However, when I try to do the same with the preview picture box, all I can get was an almost empty picture with just the card pictureboxes. There is nothing inside each card.
Any ideas, VB6 gurus?
I don't really need the preview window, all I have trying to do is to print 10 ID Cards to the printer. Each card has a picture, a barcode bitmap and some labels.
Using form.PrintForm is out since the form is bigger than the screen.
I have been banging my head as to why the graphics are missing for a l-o-n-g time. Any suggestions are more than welcomed.
October 15th, 2009, 07:05 AM
Re: Print a Form Preview Window with pictures
I think you should be able to use the PaintPicture method of the printer object, to place the images wherever you want them on the paper. However, if you want to position everything on the form, and have it print a pixel-perfect copy of it, then it might be easier to use something like Set Picture1.Picture = Picture1.Image, then use PaintPicture to get that image onto the printer object. Thing is, if any of the contents is off the edge of the screen, it might complicate things.
Please remember to rate the posts and threads that you find useful.
How can something be both new and improved at the same time?
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!