网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

vb.net控件打印,vbs 打印

VB.NET怎么实现打印功能啊 呜呜(

利用 printdocument控件

让客户满意是我们工作的目标,不断超越客户的期望值来自于我们对这个行业的热爱。我们立志把好的技术通过有效、简单的方式提供给客户,将通过不懈努力成为客户在信息化领域值得信任、有价值的长期合作伙伴,公司提供的服务项目有:主机域名虚拟主机、营销软件、网站建设、宁陕网站维护、网站推广。

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click

PrintDocument1.Print()

End Sub

Private Sub PrintDocument1_PrintPage(sender As System.Object, e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage

Dim stringFont As New Font("Arial", 16)

Dim rectDraw As New RectangleF(e.MarginBounds.Left, e.MarginBounds.Top, e.MarginBounds.Width, e.MarginBounds.Height)

Dim strFormat As New StringFormat

Dim s As String

s = "print word" '打印的内容

e.Graphics.DrawString(s, stringFont, Brushes.AliceBlue, rectDraw, strFormat)

End Sub

VB.NET 打印问题。

先拖过来控件PrintDocument1,然后双击PrintDocument1,在它的PrintPage事件中加入代码如下:

Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage

dim a as String

a="abcd"

Dim mypen As Pen = New Pen(Color.Blue, 2)

e.Graphics.DrawString(a, New Font("宋体", 20), New Pen(Color.Black, 1).Brush, 30, 30)

End Sub

调用下面语句可直接用默认打印机打印出来:

PrintDocument1.Print()

关于vb.net添加打印控件的用法

txt文件:

procedure TForm1.Button1Click(Sender: TObject);

var

MyFile: TextFile;

SourceFile:TextFile;

Tmp:String;

begin

AssignPrn(MyFile);

AssignFile(SourceFile,'FilePath');

Reset(SourceFile);

Rewrite(MyFile);

Readln(SourceFile,Tmp);

While Not EOF(SourceFile) do

Begin

Writeln(MyFile, Tmp);

Readln(SourceFile,Tmp);

System.CloseFile(MyFile);

end;

图形文件需要TPrinter.canvas来打印了,


网站名称:vb.net控件打印,vbs 打印
链接URL:http://bjjierui.cn/article/dsigepe.html

其他资讯