1
XAML/XAML.cs에서 전체 tabitem 또는 그 일부를 인쇄하려면 어떻게합니까?탭 항목 인쇄
아래 코드를 사용하여 tabitem을 인쇄 할 수 있지만 크기와 미리보기를 제어하고 싶습니다. 가로 페이지 형식을 사용하면 전체 페이지가 인쇄되지 않고 일부만 잘립니다.
TabItem Header
는 = "Stars
"
XAML :
XAML.CS
<Button Margin=" 5,5,5,5" Grid.Row="3" x:Name="PrintOilTab"
Click="PrintOilTab_Click" Content="Print" FontSize="10"/>
:
private void PrintOilTab_Click(object sender, RoutedEventArgs e)
{
System.Windows.Controls.PrintDialog Printdlg =
new System.Windows.Controls.PrintDialog();
if ((bool)Printdlg.ShowDialog().GetValueOrDefault())
{
CompleteOilLimitDiagram.Measure(
new Size(Printdlg.PrintableAreaWidth,
Printdlg.PrintableAreaHeight));
Printdlg.PrintVisual(CompleteOilLimitDiagram, "Stars");
}
}