How to construct a PaperSize object in .net

°

°Ë´óɽÈË

There is a PaperSize class in .net framework. But it has only one
constructor: [C#]public PaperSize(string name,int width,int height);
I want to create a object whose kind isn't "Customer". How shall I do?
Thank you


Jerry
 
N

Nicholas Paldino [.NET/C# MVP]

Jerry,

Why would you have to name it "Customer"? Why not just pass whatever
name you want to it?

Hope this helps.
 
°

°Ë´óɽÈË

Hi,

This name just is a description, its Kind property is "Customer"
I want to create a object whose Kind isn't "Customer".


Nicholas Paldino said:
Jerry,

Why would you have to name it "Customer"? Why not just pass whatever
name you want to it?

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

°Ë´óɽÈË said:
There is a PaperSize class in .net framework. But it has only one
constructor: [C#]public PaperSize(string name,int width,int height);
I want to create a object whose kind isn't "Customer". How shall I do?
Thank you


Jerry
 
J

Jon Skeet [C# MVP]

°Ë´óɽÈË said:
This name just is a description, its Kind property is "Customer"
I want to create a object whose Kind isn't "Customer".

I think you've confused things somewhat by saying "Customer" instead of
"Custom". As I understand it, the problem is that you want to use a
standard size of paper, rather than a custom one, correct?

It looks like the normal way of doing that is to use
PrinterSettings.PaperSizes to get a collection of paper sizes supported
by your printer, and select one of those.

Why does the kind of paper matter to you, out of interest?
 
?

????

Thank you.

I'm writing a program, need a class like PaperSize to represent a
Page, I want to
use PaperSize class, but I can't find the right Constructor. I know it by
Reflector now.
The Constructor PaperSize(string name, PaperKind kind, int width, int
height) is internal,
We can't access it. It seems that I have to write one for myself.


°Ë´óɽÈË said:
This name just is a description, its Kind property is "Customer"
I want to create a object whose Kind isn't "Customer".

I think you've confused things somewhat by saying "Customer" instead of
"Custom". As I understand it, the problem is that you want to use a
standard size of paper, rather than a custom one, correct?

It looks like the normal way of doing that is to use
PrinterSettings.PaperSizes to get a collection of paper sizes supported
by your printer, and select one of those.

Why does the kind of paper matter to you, out of interest?
 

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

Top