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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing the contents of a PictureBox 1

Status
Not open for further replies.

Denk

Programmer
Jan 4, 2000
22
0
0
GB
Can anyone confirm a small routine which prints the contents of the PictureBox control.
 
I have had good luck using the following with an iamge control, a picture box whould work same.<br>
<br>
Private Sub mnuFilePrint_Click()<br>
<br>
On Error GoTo err_handler<br>
'enable cancel button<br>
CommonDialog1.CancelError = True<br>
'disable print to file checkbox<br>
CommonDialog1.Flags = &H80000 <br>
CommonDialog1.ShowPrinter<br>
'place graphic on printer object<br>
Printer.PaintPicture frmImage.Image1.Picture, 10, 10<br>
'chase image from printer object to printer<br>
Printer.EndDoc<br>
GoTo done:<br>
<br>
err_handler:<br>
If Err.Number = 32755 Then GoTo done: 'user pressed cancel<br>
MsgBox (Err.Number & &quot; &quot; & Err.Description)<br>
<br>
done:<br>
<br>
End Sub<br>

 
Many thanks, the routine worked a treat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top