469,572 Members | 1,674 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,572 developers. It's quick & easy.

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
Nov 16 '05 #1
4 4258
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]
- mv*@spam.guard.caspershouse.com

"八大山人" <zh**********@hotmail.com> wrote in message
news:uP**************@TK2MSFTNGP10.phx.gbl...
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

Nov 16 '05 #2
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 [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:eT*************@tk2msftngp13.phx.gbl...
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]
- mv*@spam.guard.caspershouse.com

"八大山人" <zh**********@hotmail.com> wrote in message
news:uP**************@TK2MSFTNGP10.phx.gbl...
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


Nov 16 '05 #3
八大山人 <zh**********@hotmail.com> wrote:
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?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #4
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.
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
八大山人 <zh**********@hotmail.com> wrote:
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?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Pedro Feio | last post: by
reply views Thread by Raul | last post: by
reply views Thread by 八大山人 | last post: by
1 post views Thread by bafidi | last post: by
reply views Thread by Madern | last post: by
reply views Thread by Madern | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.