我需要实例类ReportPrintEventArgs [英] I need instance class ReportPrintEventArgs
本文介绍了我需要实例类ReportPrintEventArgs的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
亲爱的同事
我需要实例类ReportPrintEventArgs活跃
Dear colleagues
I need instance class ReportPrintEventArgs that active
private void reportViewer3_Print(object sender, ReportPrintEventArgs e)
{
reportViewer3.PrinterSettings.PrinterName = e.PrinterSettings.PrinterName;
reportViewer3.PrinterSettings.FromPage = e.PrinterSettings.FromPage;
reportViewer3.PrinterSettings.ToPage = e.PrinterSettings.ToPage;
e.Cancel = false;
reportViewer3.PrintDialog(reportViewer3.PrinterSettings);
nn = e;
}
另一种方法的方法
method to another method
推荐答案
你可以通过它如果你从事件处理程序中调用它,那么你需要做的就是编写一个接受ReportPrintEventArgs作为参数的方法。
但是...它不是尝试处理事件之外的事件args是一个好主意,特别是如果你试图将它们留待以后,这样一个不同的方法可以收集它们并使用它们 - 到那时它们可能很好并且真正过时了! br />
你想用不同的方法想要EventArgs做什么?
You can pass it through to another method if you call it from the event handler - all you have to do is write a method that accepts ReportPrintEventArgs as a parameter.
But...it's not a good idea to try and handle the event args outside the event, particularly if you are trying to "leave them for later" so a different method can collect them and use them - they could be well and truly out of date by then!
What are you trying to do that you want the EventArgs in a different method anyway?
这篇关于我需要实例类ReportPrintEventArgs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文