PrintDialog.PrintableAreaWidth 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取页面的可打印区域的宽度。
public:
property double PrintableAreaWidth { double get(); };
public double PrintableAreaWidth { get; }
member this.PrintableAreaWidth : double
Public ReadOnly Property PrintableAreaWidth As Double
属性值
一个表示可打印页面区域的宽度的 Double。
示例
以下示例演示如何使用可扩展应用程序标记语言 (XAML) 标记和代码获取属性的值 PrintableAreaWidth 。
<Button Width="200" Click="GetWidth">Get the Printable Width</Button>
...
private void GetWidth(object sender, RoutedEventArgs e)
{
PrintDialog pDialog = new PrintDialog();
PrintQueue pq = pDialog.PrintQueue; //force initialization of the dialog's PrintTicket or PrintQueue
txt2.Text = pDialog.PrintableAreaWidth.ToString() + " is the printable width";
}
Private Sub GetWidth(ByVal sender As Object, ByVal e As RoutedEventArgs)
Dim pDialog As New PrintDialog()
Dim pq As PrintQueue = pDialog.PrintQueue 'force initialization of the dialog's PrintTicket or PrintQueue
txt2.Text = pDialog.PrintableAreaWidth.ToString() & " is the printable width"
End Sub