Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing a Form

Status
Not open for further replies.

MarkLeT

Programmer
Feb 27, 2004
4
US
I have created a dynamic form that moves graphics and text around to match external situations. The form looks great, but I would like to print it as well and the report form will not allow the same dynamic placement of text and graphics. Is there a way to do this? (I've tried the prtscn button, but it doesn't work in Windows XP.) I'm using VFP Pro v.7.

Thanks,
Mark
 
Mark

faq184-4912 perhaps is what you are looking for?

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Mark,

Or, how about this:

Here's some code with a small DLL to make it possible to print your form to a bitmap. The Code is written by Eric den Doop, file submitted by Boudewijn Lutgerink Author: Eric den Doop Freeware - 15K Last updated: 2003-09-09 [/color blue]

I found it at
Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
Hi Mark,

Found this on the UT. Haven't tried it though.
Code:
********************************** Print the current window
function printscr()
	DECLARE INTEGER GetDesktopWindow IN Win32api
	DECLARE INTEGER PrintWindow IN DibApi32 ;
		INTEGER HWnd, ;
		INTEGER fPrintArea, ;	
		INTEGER fPrintOpt, ;	
		INTEGER wxScale, ;	
		INTEGER wyScale, ;	
		STRING @ szJobName	
	LOCAL nRetVal,cJobName && title you want to show when printing
	cJobName = 'Print Screen' && or whatever - this could be passed in as a parameter, also.
	nRetVal = PrintWindow(GetDesktopWindow(),1,1,0,0,@cJobName)	
	IF nRetVal != 0	
		IF nRetVal != 6 && 6 = User canceled printing
			MESSAGEBOX("Unable to print the window" + chr(10) + ;
						"See System Administrator " + STR(nRetVal),48, ;
						"FUBA Print Screen ")
		ENDIF	
	ENDIF
	RETURN
*Got this from someone on Universal Thread  and it works great. Any thanks should go to them.
DibApi32.dll is available from microsoft.

Regards,

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top