如何在wpf C#中打印没有背景的CHECK

时间:2016-07-20 10:28:33

标签: c# wpf devexpress-wpf

我想打印支票,所以我拍了一张背景图片,把文字块放在正确的地方,这样文字应该放在正确的地方,我的要求是我必须把支票放在打印机上,我必须显示检查时的值,所以我打算在打印后不应该在检查时显示图像 cheque

private void Button_Click_1(object sender, RoutedEventArgs e)
    {
        PrintDialog dialog = new PrintDialog();
        if (dialog.ShowDialog() == true)
        {
            dialog.PrintVisual(stackPrinting, "stackPrinting");
        }
    }

1 个答案:

答案 0 :(得分:1)

按钮点击后面的代码应该像这样希望它有效。

grdCheque.Background = new SolidColorBrush();
        PrintDialog dialog = new PrintDialog();
        if (dialog.ShowDialog() == true)
        {
            dialog.PrintVisual(grdCheque, "grdCheque");
            this.Close();
        }