-
October 10th, 2004, 10:05 PM
#1
Printing controls in a picturebox
In the following example, how does one setup the printer for printing a shape, Line and picturebox object.
For each ctrl In myScreen.controls
If ctrl.container.name = "myPictureBox" then
If TypeOf ctrl is TextBox then
Printer.currentX = ctrl.left
Printer.currentY = ctrl.top
Printer.Print ctrl
ElseIf TypeOf ctrl is Shape then
???
ElseIf TypeOf ctrl is Line then
???
ElseIf TypeOf ctrl is Picture then
??
End If
End If
Printer.EndDoc
Next
-
October 11th, 2004, 01:56 AM
#2
Re: Printing controls in a picturebox
It would probably be much easier to take a screen capture of the area you want to print, and send that to the printer.
Please remember to rate the posts and threads that you find useful.
How can something be both new and improved at the same time?
-
October 11th, 2004, 11:37 AM
#3
Re: Printing controls in a picturebox
The area I need to capture and send to the printer is larger than the screen. It will print out a complete 8.5 x 11 inch document. I'm working with the keybd_event API, setting the form to the size of the area I am trying to capture (which exceeds the window screen), and then trying to capture all of the form with keybd_event VK_SNAPSHOT, 1&, 0&, 0&. I'm only able to capture what is visible on the screen and not all of the form. Is it possible to capture all of the form, even though it is not all showing on the screen?
-
October 11th, 2004, 02:12 PM
#4
Re: Printing controls in a picturebox
If you want to print an entire form, perhaps the PrintForm method will work for you. For a picturebox only, you may find this post I made to be helpfull: http://www.codeguru.com/forum/showth...16#post1011416
Please remember to rate the posts and threads that you find useful.
How can something be both new and improved at the same time?
-
October 11th, 2004, 03:50 PM
#5
Re: Printing controls in a picturebox
The code you attached was along the lines of what I need to do but I cannot figure out how to get there. Basically, I need to take the objects in one picture box and make them the picture of another picture box. That way, I can do a printout with PaintPicture. Any suggestions?
-
October 11th, 2004, 04:08 PM
#6
Re: Printing controls in a picturebox
If there will only be text, lines, shapes, and images, I'd likely draw those elements via API, thus they will be part of the image.
Please remember to rate the posts and threads that you find useful.
How can something be both new and improved at the same time?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|