获取或设置打印文档时要显示的文档名(例如,在打印状态对话框或打印机队列中显示)。
命名空间: 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)
属性值
类型:System.String
显示的 String ,在打印文档时。默认情况下为“文档”。
备注
DocumentName 属性不指定要打印的文件。相反,您指定输出通过调用 Print 方法打印。
示例
下面的示例演示如何使用 DocumentName 属性公开文档名称,在打印时。此示例要求您具有名为在窗体的 PrintForm1 的一个 PrintForm 元素。
' 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)