获取或设置打印文档时要显示的文档名称(例如,在打印状态对话框或打印机队列中)。
命名空间: 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 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关详细信息,请参阅通过部分受信任的代码使用库。
请参阅
参考
Microsoft.VisualBasic.PowerPacks.Printing 命名空间
其他资源
如何:使用 PrintForm 组件打印窗体 (Visual Basic)