PrintDialog.PrintableAreaWidth Propriedade
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Obtém a largura da área imprimível da página.
public:
property double PrintableAreaWidth { double get(); };
public double PrintableAreaWidth { get; }
member this.PrintableAreaWidth : double
Public ReadOnly Property PrintableAreaWidth As Double
Valor de Propriedade
A Double que representa a largura da área da página imprimível.
Exemplos
O exemplo seguinte mostra como obter o valor da PrintableAreaWidth propriedade utilizando marcação e código Extensible Application Markup Language (XAML).
<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