Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
I learned how to PRINT a WPF window!
Message
De
28/07/2008 17:24:18
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Windows Presentation Foundation (WPF)
Titre:
I learned how to PRINT a WPF window!
Divers
Thread ID:
01334707
Message ID:
01334707
Vues:
50
I was just about to ask here, and then Googled it and found the answer...

How do you PRINT a WPF window?

It's crazy simple...
        private void btnPrint_Click(object sender, RoutedEventArgs e)
        {
            PrintDialog prtDlg = new PrintDialog();
            if(prtDlg.ShowDialog() == true)
            {
                prtDlg.PrintVisual(ElementNameHere, "Title Here");  // The Name you call the Window in the XAML file
            }
        }
You can also send just a Canvas, or a ListView, or any single element or container that you can provide the name of.

Here are the links where I found this very helpful info:

http://itknowledgeexchange.techtarget.com/wpf/printing-with-wpf/
http://itknowledgeexchange.techtarget.com/wpf/wpf-printing-using-printvisual/
http://itknowledgeexchange.techtarget.com/wpf/wpf-printing-why-is-it-small/
http://itknowledgeexchange.techtarget.com/wpf/wpf-printing-use-the-printing-page/
http://itknowledgeexchange.techtarget.com/wpf/wpf-printing-documents/
http://itknowledgeexchange.techtarget.com/wpf/wpf-problems-printing-documents/
Répondre
Fil
Voir

Click here to load this message in the networking platform