Jonathan Allen

Using WPF, I have laid out a really nice looking form on the screen. Is there a way to send it more or less as is to the printer Or do I have to start over from scratch writing print code.

Re: Windows Presentation Foundation (WPF) Print the contents of a form

Dennis Cheng - MSFT

Sure, use PrintDialog.PrintVisual or PrintDocument: http://msdn2.microsoft.com/en-us/library/aa969772.aspx






Re: Windows Presentation Foundation (WPF) Print the contents of a form

publicENEMY

Does this technique applicable to printing activex content(using winform interop) can someone clarify this



Re: Windows Presentation Foundation (WPF) Print the contents of a form

Jonathan Allen

Thanks.

Do you have any recommedations for learning WPF

I am specifically interested in learning the ins and outs of creating data-bound GUI forms that are also printable, but all the books at my local bookstore don't even mention printing.

Jonathan





Re: Windows Presentation Foundation (WPF) Print the contents of a form

corbin

I've done this before and I got mixed results with hosting a Windows Forms control inside a WindowsFormsHost then attempting to use PrintVisual on it.

It does work so you may want to try it (I've never done the ActiveX hosting though).





Re: Windows Presentation Foundation (WPF) Print the contents of a form

corbin

The SDK has some of the best print samples you can find:
e.g. C:\Program Files\Microsoft SDKs\Windows\v6.0\Samples\WPFSamples\DocServices\XpsPrint







Re: Windows Presentation Foundation (WPF) Print the contents of a form

publicENEMY

Hi Corbin.

Tried that. WPF-winform-activex. The result are not what I expected. Inherit interop limitations.

Thanks.