VB.net中的字符串打印 [英] String Printing in VB.net

查看:87
本文介绍了VB.net中的字符串打印的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我刚开始使用VB.Net进行打印.

我环顾四周,似乎发现了很多有关System.Drawing.Printing的信息.但是我不知道如何将字符串传递给它进行打印.就像这样简单:

dim Text as String =这是测试文本"

System.Drawing.Printing.(PrintText)我知道printtext不是函数" = Text
System.Drawing.Printing.Print()

我是不是在找错地方来做我想做的事情,System.Drawing.Printing似乎仅支持打印出已经存在的文件.

谢谢,

Caz

Hi Guys,

I am just starting out with printing in VB.Net.

I have had a look around and seem to find a lot of information around System.Drawing.Printing which I have played around with. But I can not figure out how to pass a string to that to print. Something as simple as:

dim Text as String = "This is test text"

System.Drawing.Printing.(PrintText) "I know printtext is not a function" = Text
System.Drawing.Printing.Print()

Am I looking in the wrong spot to do what I want to do, System.Drawing.Printing only seems to support printing out a file that already exists.

Thanks,

Caz

推荐答案

我发现 [ ^ ]与Google在一起.
I found this[^] with google.


您将需要研究PrintDocument. PrintDocument对象具有要处理的PrintPage事件,并且具有可以在其上绘制文本,形状和图像的图形对象.

http://msdn.microsoft.com/en -us/library/system.drawing.printing.printdocument(v = vs.71).aspx [
You will need to research the PrintDocument. The PrintDocument object has a PrintPage event that you handle and has a graphics object that you can draw text, shapes, images on.

http://msdn.microsoft.com/en-us/library/system.drawing.printing.printdocument(v=vs.71).aspx[^]


这篇关于VB.net中的字符串打印的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆