vb打印功能(vb printing function)

vb打印功能(vb printing function)

ID:9288928

大小:26.64 KB

页数:27页

时间:2018-04-26

vb打印功能(vb printing function)_第1页
vb打印功能(vb printing function)_第2页
vb打印功能(vb printing function)_第3页
vb打印功能(vb printing function)_第4页
vb打印功能(vb printing function)_第5页
资源描述:

《vb打印功能(vb printing function)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、vb打印功能(VBprintingfunction)UsingVBtoachievethequeryfunction,inordertoprintouttheresultsofthequery,howtoachieve?.Howshouldthespecificprogramstatementbewritten?printfromapplicationsVisualBasicprovidesthreetechniquesforprintingtextandgraphics.Youcanbuildthere

2、quiredoutputintheform,andthenprinttheformwiththePrintFormmethod.PrivateSubCommand1_Click()Me.PrintFormEndSubBysettingthedefaultprinterinthePrinterscollection,thetextandgraphicscanbesenttotheprinter....YoucansendtextandgraphicstoPrinterobjectsfirst,thenpri

3、ntthemwithNewPageandEndDocmethods.OptionExplicitPrivateyAsIntegerPrivatexAsIntegerPrivateTXTAsStringPrivatefntAsIntegerPrivateDDAsVariantPrintingfunctionPublicFunctionPRNT(x,As,y,As,FNT,As,TXT,As,Variant,Variant,Variant,Variant)Printer.CurrentX=xPrinter.C

4、urrentY=yPrinter.FontSize=fntPrinter.PrintTXTEndFunctionPrivateSubcmdPrint_Click()FNT=18Y=300X=500Txt="print""DD=PRNT(x,y,FNT,txt)Printer.EndDoc'printfinished.EndSubForexample,dataquery,pleaserefertothefollowingurl:Http://zhidao.baidu.com/question/4168806

5、.htmlVBIwanttoachievethepreviewfunctionbeforeprint,howtoachieve?Generallybythirdpartycontrols,VBitselfdoesnothavethisfeature,ofcourseIreferstotheVB5.0/6,ifyouareusingaVB2003/2005,therewillbeaprintpreviewfunction,butalsomoreperfectthanVB6printcontrol.Toach

6、ievetheprintfunction,youneedapublicdialogboxCommonDialog,intheengineeringmenu-component-selectMicrsoftcommondialogcontrol6Code:PrivateSubCommand1_click()CommonDialog1.ShowPrinterorCommonDialog1.Action=5EndWhatkindofprinteryoucanprintoutifyouhaveaprinter?P

7、rinterobjectThePrinterobjectcancommunicatewiththesystemprinterPrinterobjectscommonlyusedattributes:Height,width,PaperSize,DeviceName,respectively,indicatingthelengthofprintedpaper,width,sizeofpaper,printername.ThePrinterobjecthasthreeimportantmethods:EndD

8、oc,KillDoc(print)(interruptprinting)andNewPage(page).Forexample,thereisa"payattentionto26dayvirus"!"Itisnecessarytoprint10copies,addpagenumbers,andusethefollowingprocedures:PrivateSubcommand_Click()DimIAsIntegerDims

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。