wekelly Posted February 18, 2009 Report Share Posted February 18, 2009 I could not get my chart to print. I narrowed it down to the Chart.UseEffects property. In the following, when UseEffects is false, the chart does not print. When UseEffects is true, the chart prints. using System; using System.Windows; using System.Windows.Controls; using System.Windows.Input; using ChartFX.WPF; class Program { [sTAThread] static void Main(string[] args) { bool isPrintSuccessful = false; Window w = new Window(); Chart c = new Chart() { UseEffects = isPrintSuccessful }; w.Content = c; // ctrl-p to print w.CommandBindings.Add(new CommandBinding(ApplicationCommands.Print, OnPrint)); new Application().Run(w); } static void OnPrint(object sender, EventArgs e) { PrintDialog dlg = new PrintDialog(); if (dlg.ShowDialog().Value) dlg.PrintVisual(sender as Window, "My Chart"); } } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.