String drawString = "Sample Text"; // Create font and brush. Font drawFont = new Font("Arial", 16); SolidBrush drawBrush = new SolidBrush(Color.Black); // Create rectangle for drawing. float x = 350.0F; float y = 150.0F; float width = 200.0F; float height = 50.0F; RectangleF drawRect = new RectangleF(x, y, width, height); // Draw rectangle to screen. Pen blackPen = new Pen(Color.Red); e.Graphics.DrawRectangle(blackPen, x, y, width, height); // Draw string to screen. e.Graphics.DrawString(drawString, drawFont, drawBrush, drawRect); e.Graphics.DrawString(this.textBox5.Text, this.textBox1.Font, Brushes.Black, 10, 25); private void button6_Click(object sender, EventArgs e) { printdocument1.print; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)