making sure a text box is same size as an A4 sheet

fguihen

Junior Contributor
Joined
Nov 10, 2003
Messages
248
Location
Eire
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?
 
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:

Code:
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.
 
Back
Top