请大家帮忙看看怎样设置?现在程序是本地打印,怎样才能加入网络一起打印。
DEFINE CLASS printform AS Form
TOP = 250
LEFT = 150
HEIGHT = 110
WIDTH = 330
BORDERSTYLE = 2
CAPTION = '打印窗口'
CLOSABLE = .F.
CONTROLBOX = .T.
MAXBUTTON = .F.
MINBUTTON = .F.
MOVABLE = .F.
VISIBLE = .T.
BACKCOLOR = RGB(255,255,255)
NAME = 'printform'
ADD OBJECT PRINTLABEL AS LABEL WITH TOP = 20 , LEFT = 20 , FONTSIZE = 16 , AUTOSIZE
;
= .T. , FONTITALIC = .T. , CAPTION = '打印窗口欢迎您!' , BACKCOLOR =
;
RGB(192,192,192) , FORECOLOR = RGB(255,0,0) , NAME = 'printlabel'
ADD OBJECT PRINTSTAR AS COMMANDBUTTON WITH FONTSIZE = 11 , FONTNAME = '宋体' ,
;
CAPTION = '开始打印' , HEIGHT = 25 , TOP = 70 , LEFT = 70 , WIDTH = 80 ,
;
VISIBLE = .T. , NAME = 'printstar'
ADD OBJECT PRINTCANC AS COMMANDBUTTON WITH FONTSIZE = 11 , FONTNAME = '宋体' ,
;
CAPTION = '取消打印' , HEIGHT = 25 , TOP = 70 , LEFT = 170 , WIDTH = 80 ,
;
VISIBLE = .T. , NAME = 'printcanc'
ADD OBJECT PRINTFINISH AS COMMANDBUTTON WITH FONTSIZE = 11 , FONTNAME = '宋体' ,
;
CAPTION = '完 成' , HEIGHT = 25 , TOP = 70 , LEFT = 80 , WIDTH = 50 ,
;
VISIBLE = .F. , NAME = 'printfinish'
ADD OBJECT PRINTFAIL AS COMMANDBUTTON WITH FONTSIZE = 11 , FONTNAME = '宋体' ,
;
CAPTION = '失 败' , HEIGHT = 25 , TOP = 70 , LEFT = 180 , WIDTH = 50 ,
;
VISIBLE = .F. , NAME = 'printfail'
PROCEDURE printstar.Click
IF SYS(13) = 'OFFLINE'
?? CHR(7)
THISFORM.PRINTLABEL.CAPTION = '打印机没有准备好! 请检查.'
RETURN
ENDIF
SET DEVICE TO PRINTER
SET PRINTER FONT '宋体' , 12.3
@ 4.900 , 10 SAY LYSARY(1,1)
ENDIF
@ 18.500 , 82 SAY CZY
SET PRINTER TO
SET DEVICE TO SCREEN
THISFORM.PRINTLABEL.CAPTION = '打印完成?'
THISFORM.PRINTSTAR.VISIBLE = .F.
THISFORM.PRINTCANC.VISIBLE = .F.
THISFORM.PRINTFINISH.VISIBLE = .T.
THISFORM.PRINTFAIL.VISIBLE = .T.
ENDPROC
*------
PROCEDURE printcanc.Click
CKFORMSET.PRINTFORM.HIDE
CKFORMSET.CKFORM.ALWAYSONTOP = .T.
CKFORMSET.CKFORM.ENABLED = .T.
CKFORMSET.CKFORM.FINISH.ENABLED = .F.
CKFORMSET.CKFORM.CKXG.ENABLED = .F.
CKFORMSET.CKFORM.BYFXG.ENABLED = .F.
CKFORMSET.CKFORM.CKFORMCLS.ENABLED = .T.
CKFORMSET::INIT
CKFORMSET.CKFORM.REFRESH
CKFORMSET.CKFORM.HZHTEXTBOX.DISABLEDBACKCOLOR = RGB(192,192,192)
CKFORMSET.CKFORM.HZMCTEXTBOX.DISABLEDBACKCOLOR = RGB(192,192,192)
CKFORMSET.CKFORM.KCJS1.DISABLEDFORECOLOR = RGB(255,255,255)
CKFORMSET.CKFORM.KCBS1.DISABLEDFORECOLOR = RGB(255,255,255)
= OBJECTSET(1,255,.T.)
= OBJECTSET(2,192,.F.)
= OBJECTSET(3,192,.F.)
= OBJECTSET(4,192,.F.)
= BYF(1)
CKFORMSET.CKFORM.SPPH1.SETFOCUS
ENDPROC
*------
PROCEDURE printfinish.Click
THISFORM.PRINTSTAR.VISIBLE = .T.
THISFORM.PRINTCANC.VISIBLE = .T.
THISFORM.PRINTFINISH.VISIBLE = .F.
THISFORM.PRINTFAIL.VISIBLE = .F.
PRINTFORM.PRINTCANC::CLICK
ENDPROC
*------
PROCEDURE printfail.Click
THISFORM.PRINTSTAR.VISIBLE = .T.
THISFORM.PRINTCANC.VISIBLE = .T.
THISFORM.PRINTFINISH.VISIBLE = .F.
THISFORM.PRINTFAIL.VISIBLE = .F.
THISFORM.PRINTLABEL.CAPTION = '打印窗口欢迎您!'
ENDPROC
[
本帖最后由 pylyh 于 2015-5-20 23:27 编辑 ]