473,503 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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

Nov 16 '05 #1
2 1076
Nevermind, I figured it out...Here is the solution:
In Class1
{
public static PrintDocument pd = new PrintDocument();
}

Thanks,
Trint

Nov 16 '05 #2

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

Hope This Helps
Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
12092
by: Hasani | last post by:
How do I stop or hide the 'Printing' dialog box from showing when the method PrintDocument.Print is invoked?
3
12362
by: Randy | last post by:
Hello, I'm trying to print a dataGrid using PrintDocument control. My datagrid has about 23 columns so it is fairly wide. When I use the PrintControl, it prints only the part of the dataGrid that...
1
295
by: JMMB | last post by:
A PrintDocument created in a Windows Apps is printer device independent? No problems with older printers? thanks,
1
2402
by: Frank Rizzo | last post by:
Hello, I have an OCX control on my WinForm (don't ask, i have to use it) and it generally works well. One of the methods of the OCX prints to an hDC (device context handle for history buffs). ...
2
7316
by: dirichle | last post by:
Does anyone know any dotnet component which can transform a printDocument to a PDF file ? thanx
0
1392
by: active | last post by:
Dim mPD As PrintDocument Dim mPrinternameSaved As PrintDocument Public WriteOnly Property PrintDocument() As PrintDocument Set(ByVal value As PrintDocument) mPD = value mPrinternameSaved = mPD...
0
1146
by: toufik | last post by:
I'm using a printDocument object to print a text. How can I set the paper size fomat to LETTER format here is the code that I started, I don't know if its the good direction....
8
1783
by: Hansen | last post by:
Hi I have a form with multiple labels and textboxes and listboxes that need to be made visible and not visible when buttons are clicked. Is there anyway of grouping them together so that I have...
2
6610
by: bp | last post by:
Hi, I try to use my own PreviewDialog with a PrinPreviewControl, to preview a document of type MyPrintDocument, and I want to implement the PrintRange functionnality (print some pages between 2...
0
7076
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7274
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6984
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7453
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5576
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5005
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3151
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1507
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
732
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.