17-04-13, 07:31 PM
(آخر تعديل لهذه المشاركة : 21-04-13, 03:43 AM {2} بواسطة wisambarcelona.)
السلام عليكم
لازم تضيف الكنترول CommonDialog
شوف هذا الكود لقيته وجربته يطبع الصورة اللي في image1
لازم تضيف الكنترول CommonDialog
شوف هذا الكود لقيته وجربته يطبع الصورة اللي في image1
كود :
Private Sub Command1_Click()
StopPrinting = False
' Set CancelError is True
On Error GoTo errhandler
CommonDialog1.PrinterDefault = True
CommonDialog1.CancelError = True
' Set flags
CommonDialog1.Flags = cdlPDReturnDC + cdlPDNoPageNums
CommonDialog1.ShowPrinter
Printer.PaintPicture Me.Image1.Picture, 0, 0
Printer.EndDoc
Exit Sub
errhandler:
Select Case Err
Case 32755 ' Dialog Cancelled
MsgBox "you cancelled the dialog box"
Case Else
MsgBox "Unexpected error. Err " & Err & " : " & Error
End Select
End Sub
