|
-
April 18th, 2001, 03:22 AM
#1
Urgent - Printing a Form Without Using Printform method
Hi,
I am in a Urgent need to solve a problem which has to get solved in a fast manner. I need u peoples' help.
My problem is, my client wants to print his forms thro our program itself. We gave him the option to print using the "form.Printform" method. But this is not printing properly in all the printers. Some printers is printing some junk characters instead of printing the form.
So is there is any other way usig API to solve this? I want a reply from u genltle and genius guys which is going to solve my problem.
Thanks in Advance
Regards
Bala
-
April 18th, 2001, 07:28 AM
#2
Re: Urgent - Printing a Form Without Using Printform method
Last month's "Developer of the month" code at http://www.visualbuilder.com is a print preview DLL (with source) that does exactly this.
HTH,
D.
-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com
-
April 18th, 2001, 08:53 AM
#3
Re: Urgent - Printing a Form Without Using Printform method
Method 1:
Use the GetDC(GetDeskTopWindow()) API call combination to get the hDC of the desktop.
Use the SetWindowPos() to bring your window to the top.
Use GetClientRect() to find the coordinates of your window.
Use BitBlt() to copy this portion to a picturebox.
Finally, use Printer.Paintpicture to print the image on the picturebox.
Method 2:
Use SetWindowPos() to bring your window to the top.
Use SendKeys "%{PRTSC}" to send a Alt-PrintScreen combination that puts an image of the form with focus onto the clipboard. I'm not sure about this step though.
Use Clipboard.Getdata to paste this information onto a picturebox.
Finally, use Printer.Paintpicture to print the image on the picturebox.
-
April 18th, 2001, 10:34 AM
#4
Re: Urgent - Printing a Form Without Using Printform method
Hi,
Thanks for ur help and I tried the 2nd method. But i didn't get the picture in the clipboard itself. What could be the problem. I think that problem may be with the sendkeys.
If u can able to send the detailed code, that's is very use ful to me. I didn;t tried the 1st method since it has some more complicated functions than the 2nd one.
Regards
Bala
-
April 18th, 2001, 10:37 AM
#5
Re: Urgent - Printing a Form Without Using Printform method
Hi,
Since i didn't use that page, i struck with some complicated things. Where should I search the "Developer of the Month" in the specified Site.
Pl. help me out from this problem
Regards
Bala
-
April 18th, 2001, 10:46 AM
#6
Re: Urgent - Printing a Form Without Using Printform method
Oops - I gave you the wrong url.
Try http://www.freevbcode.com/ShowCode.Asp?ID=2428
HTH,
D
-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com
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
|