How can I make this PrintDocument visible to it's calls?

  • Thread starter Thread starter trint
  • Start date Start date
T

trint

PrintDocument pd = new PrintDocument();

Can I put it in "Class1.cs"?
If so, how can it become visible within the scope of the function of
it's call?
Class1.pd.PrintPage += new PrintPageEventHandler(this.pd_PrintPage);
Doesn't work.
Thanks,
Trint
 
Nevermind, I figured it out...Here is the solution:
In Class1
{
public static PrintDocument pd = new PrintDocument();
}

Thanks,
Trint
 
"YourNamespace".pd.PrintPage += new
PrintPageEventHandler(this.pd_PrintPage);
You have to use Namespace.pd instead of FileName.pd

Hope This Helps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top