PrintDialog.PrintableAreaHeight Eigenschap

Definitie

Hiermee haalt u de hoogte van het afdrukbare gebied van de pagina op.

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

Waarde van eigenschap

Een Double die de hoogte van het afdrukbare paginagebied aangeeft.

Voorbeelden

In het volgende voorbeeld ziet u hoe u de waarde van de PrintableAreaHeight eigenschap kunt ophalen met behulp van XAML-markeringen (Extensible Application Markup Language) en code.

<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

Van toepassing op