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!

DrawText/Printing

Status
Not open for further replies.

hansu

Programmer
Mar 12, 2002
89
To print out data from a recordset I created a picturebox in order to offer a print preview to the user. The positioning of the text works fine with the print method. For multipleline text I used the API function DrawText which also positions the text correctly in the picturebox.
To print it out I set the picturebox to the printer object.

Code:
Dim ob as Object
Set ob = Printer

The text created with DrawText looses now the positioning and appears in the upper left corner. I am new to API functions. Can I use DrawText to print out and how does it have to be done?
Thanks for your assistance.
 
Just a guess, but are you inadvertantly refreshing the picture box. The printer scaling is 5 to 10 times that of the picture box, so does have this sort of effect. I did the same thing with textout until I realised what was going on. Peter Meachem
peter@accuflight.com

Support Joanna's Bikeathon
 
Thank you Peter.
No I am not refreshing the picturebox.
Does it mean I have to increase CurrentX and CurrentY resp. the RECT values 5 to 10 times in the Printer object?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top