PrintForm.DocumentName 属性

获取或设置打印文档时要显示的文档名称(例如,在打印状态对话框或打印机队列中)。

命名空间:  Microsoft.VisualBasic.PowerPacks.Printing
程序集:  Microsoft.VisualBasic.PowerPacks.Vs(在 Microsoft.VisualBasic.PowerPacks.Vs.dll 中)

语法

声明
<BrowsableAttribute(True)> _
Public Property DocumentName As String
[BrowsableAttribute(true)]
public string DocumentName { get; set; }
[BrowsableAttribute(true)]
public:
property String^ DocumentName {
    String^ get ();
    void set (String^ value);
}
[<BrowsableAttribute(true)>]
member DocumentName : string with get, set
function get DocumentName () : String 
function set DocumentName (value : String)

属性值

类型:String
一个String以打印文档时显示。默认为“文档”。

备注

DocumentName属性不指定要打印的文件。 相反,您指定要通过调用打印的输出Print方法。

示例

下面的示例演示如何使用DocumentName属性显示在打印时该文档的名称。 此示例要求您有PrintForm名 PrintForm1 为窗体上的组件。

' Print to a printer. 
PrintForm1.PrintAction = Printing.PrintAction.PrintToPrinter
' Assign a document name.
PrintForm1.DocumentName = "Quarterly Results Graph"
' Send to the printer.
PrintForm1.Print()

.NET Framework 安全性

请参阅

参考

PrintForm 类

Microsoft.VisualBasic.PowerPacks.Printing 命名空间

其他资源

PrintForm 组件 (Visual Basic)

如何:使用 PrintForm 组件打印窗体 (Visual Basic)

如何:打印窗体的工作区 (Visual Basic)

如何:打印窗体的工作区和非工作区 (Visual Basic)

如何:打印可滚动的窗体 (Visual Basic)

部署引用 PrintForm 组件的应用程序 (Visual Basic)