private void Form1_Load(object sender, EventArgs e) { using (Graphics g=this.CreateGraphics()) { label1.Text = g.DpiX.ToString(); label2.Text = g.DpiY.ToString(); //width:5 inch //height:7 inch //textBox1.Size =new Size( (int)Math.Ceiling(5 * g.DpiX), (int)Math.Ceiling(7*g.DpiY)); int width = (int)(5 * g.DpiX); int height = (int)(7 * g.DpiY); textBox1.Size = new Size(width, height); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)