v formu:
Public Declare Function DrawText Lib "user32" Alias "DrawTextA" (ByVal hdc As Long, ByVal lpStr As String, ByVal nCount As Long, lpRect As RECT, ByVal wFormat As Long) As Long
Public Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
(ili private declare )
V knopku:
sub myprint()
on error goto errhdl
dim rc as rect
set prn = printers (1)
with rc
left = 10
top = 10
right = 400
bottom = 400
end with
drawtext prn.hdc, text1.text & chr(0), len(text1.text)+1, rc, DT_LEFT or DT_TOP
prn.enddoc
exit sub
errhdl:
msgbox "An error occured while printing to " & prn.devicename & ": " & err.description
end sub
Max! писал(а):Я пишу этот код в событие Click может надо вдругое событие!
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 83