Hi Shahzad786,
Check this example. Now please take its reference and correct your code.
Code
C#
private void button1_Click(object sender, EventArgs e)
{
PrintDocument1.DefaultPageSettings.Landscape = true;
PrintPreviewDialog1.Document = PrintDocument1;
PrintPreviewDialog1.PrintPreviewControl.Zoom = 1;
PrintPreviewDialog1.ShowDialog();
}
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
e.Graphics.DrawString(TextBox1.Text, new Font("Time New Romans", 14, FontStyle.Bold), Brushes.Black, new PointF(200, 400));
e.Graphics.RotateTransform(90);
e.Graphics.DrawString(TextBox2.Text, new Font("Time New Romans", 14, FontStyle.Bold), Brushes.Red, new PointF(300, -400));
}
VB.Net
Private Sub button1_Click(sender As Object, e As EventArgs) Handles button1.Click
PrintDocument1.DefaultPageSettings.Landscape = True
PrintPreviewDialog1.Document = PrintDocument1
PrintPreviewDialog1.PrintPreviewControl.Zoom = 1
PrintPreviewDialog1.ShowDialog()
End Sub
Private Sub PrintDocument1_PrintPage(sender As Object, e As Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
e.Graphics.DrawString(TextBox1.Text, New Font("Time New Romans", 14, FontStyle.Bold), Brushes.Black, New PointF(200, 400))
e.Graphics.RotateTransform(90)
e.Graphics.DrawString(TextBox2.Text, New Font("Time New Romans", 14, FontStyle.Bold), Brushes.Red, New PointF(300, -400))
End Sub
Screenshot