Reputation: 761
Im trying to print everything within a wpf control - lets say a grid.
I read about printvisual method, but its not visible to me.
My code looks like this:
private void print(FrameworkElement element)
{
PrintDialog printDlg = new PrintDialog();
printDlg.PrintVisual(element, "this is a test");
}
and my compiler says does not contain a definition for PrintVisual method. I already included System.Windows.Media.Visual namespace but that didnt help aswell.
Thanks for your help
Upvotes: 0
Views: 486
Reputation: 172
Maybe you have the wrong using :
using System.Windows.Forms;
instead of using System.Windows.Controls;
The PrintDialog
is in both but one doesn't have the PrintVisual()
method.
Upvotes: 1