Share via


PrintDialog.PrintableAreaHeight Vlastnost

Definice

Získá výšku tisknutelné oblasti stránky.

public:
 property double PrintableAreaHeight { double get(); };
public double PrintableAreaHeight { get; }
member this.PrintableAreaHeight : double
Public ReadOnly Property PrintableAreaHeight As Double

Hodnota vlastnosti

A Double , která představuje výšku tisknutelné oblasti stránky.

Příklady

Následující příklad ukazuje, jak získat hodnotu PrintableAreaHeight vlastnosti pomocí kódu XAML (Extensible Application Markup Language) a kódu.

<Button Width="200" Click="GetHeight">Get the Printable Height</Button>

...

private void GetHeight(object sender, RoutedEventArgs e)
{
    PrintDialog pDialog = new PrintDialog();
    PrintTicket pt = pDialog.PrintTicket;   //force initialization of the dialog's PrintTicket or PrintQueue
    txt1.Text = pDialog.PrintableAreaHeight.ToString() + " is the printable height";
}
Private Sub GetHeight(ByVal sender As Object, ByVal e As RoutedEventArgs)
    Dim pDialog As New PrintDialog()
    Dim pt As PrintTicket = pDialog.PrintTicket 'force initialization of the dialog's PrintTicket or PrintQueue
    txt1.Text = pDialog.PrintableAreaHeight.ToString() & " is the printable height"
End Sub

Platí pro