PrintForm 类
启用打印 windows 窗体的图像在运行时。
继承层次结构
System.Object
System.MarshalByRefObject
System.ComponentModel.Component
Microsoft.VisualBasic.PowerPacks.Printing.PrintForm
命名空间: Microsoft.VisualBasic.PowerPacks.Printing
程序集: Microsoft.VisualBasic.PowerPacks.Vs(在 Microsoft.VisualBasic.PowerPacks.Vs.dll 中)
语法
声明
<ToolboxBitmapAttribute(GetType(PrintForm), "Microsoft.VisualBasic.PowerPacks.Printing.PrintForm.bmp")> _
Public Class PrintForm _
Inherits Component
[ToolboxBitmapAttribute(typeof(PrintForm), "Microsoft.VisualBasic.PowerPacks.Printing.PrintForm.bmp")]
public class PrintForm : Component
[ToolboxBitmapAttribute(typeof(PrintForm), L"Microsoft.VisualBasic.PowerPacks.Printing.PrintForm.bmp")]
public ref class PrintForm : public Component
[<ToolboxBitmapAttribute(typeof(PrintForm), "Microsoft.VisualBasic.PowerPacks.Printing.PrintForm.bmp")>]
type PrintForm =
class
inherit Component
end
public class PrintForm extends Component
PrintForm 类型公开以下成员。
构造函数
名称 | 说明 | |
---|---|---|
![]() |
PrintForm() | 初始化 PrintForm 类的新实例。 |
![]() |
PrintForm(IContainer) | 初始化 PrintForm 类的新实例,指定它将父节点的 IContainer 。 |
![]() |
PrintForm(Form) | 初始化 PrintForm 类的新实例,指定它将父节点的 Form 。 |
页首
属性
名称 | 说明 | |
---|---|---|
![]() |
CanRaiseEvents | 获取一个指示组件是否可以引发事件的值。 (继承自 Component。) |
![]() |
Container | 获取 IContainer,它包含 Component。 (继承自 Component。) |
![]() |
DesignMode | 获取一个值,用以指示 Component 当前是否处于设计模式。 (继承自 Component。) |
![]() |
DocumentName | 获取或设置打印文档时要显示的文档名(例如,在打印状态对话框或打印机队列中显示)。 |
![]() |
Events | 获取附加到此 Component 的事件处理程序的列表。 (继承自 Component。) |
![]() |
Form | 获取或设置要打印的窗体。 |
![]() |
PrintAction | 获取或设置一个输出是否的值的过程,到打印机、打印预览窗口,或者到文件。 |
![]() |
PrinterSettings | 获取或设置可用于指定打印机的各种属性 PrinterSettings 对象。 |
![]() |
PrintFileName | 获取或设置文件将保存一个封装的 PostScript 文件和路径的文件名,当 PrintAction 属性设置为 PrintToFile时。 |
![]() |
Site | 获取或设置 Component 的 ISite。 (继承自 Component。) |
页首
方法
页首
事件
名称 | 说明 | |
---|---|---|
![]() |
BeginPrint | 出现问题,则 Print 方法调用,因此,在打印文档的第一页之前。 |
![]() |
Disposed | 当通过调用 Dispose 方法释放组件时发生。 (继承自 Component。) |
![]() |
EndPrint | 打印完文档的最后一页时发生。 |
![]() |
QueryPageSettings | 在打印每一页之前发生。 |
页首
备注
PrintForm 元素可以将窗体的图像打印到打印机,、打印预览窗口,或者到文件中。 其行为取代了 Visual Basic 早期版本中 PrintForm 方法的行为。
示例
下面的示例演示 PrintForm 组件的一种常见用法。
Dim pf As New PrintForm
pf.Form = Me
pf.PrintAction = PrintToPrinter
pf.Print()
线程安全
此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。但不保证所有实例成员都是线程安全的。
请参见
参考
Microsoft.VisualBasic.PowerPacks.Printing 命名空间
其他资源
如何:使用 PrintForm 组件打印窗体 (Visual Basic)