Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
i want to be able to type a report into a text box, and then print it out , as it is in the text box. im using a rich textbox. how do i make sure the text box is the same size as an A4 sheet?
Posted

What is the width and height of an A4 paper?

 

The best way I know to do this is with code similiar to the following:

 

this.richtextbox.width = this.CreateGraphics.dpiX * <width_of_A4_in_inches>;
this.richtextbox.height = this.CreateGraphics.dpiY * <height_of_A4_in_inches>;

Where you need to put that code is determined by the program, and the form it's on and stuff. If it wont be resized, then you can just put that in the Form_Load method.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...