I have below code to print richtextbox text. My textbox contains Regular and bold text but below code print either bold or reguler text. How can i print text as it is in the text box.
Private Sub PrintToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PrintToolStripMenuItem.Click
If PrintDialog1.ShowDialog() = DialogResult.OK Then
Try
Dim printdoc As New PrintDocument
AddHandler printdoc.PrintPage, AddressOf Me.PrintText
printdoc.Print()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End If
End Sub
Private Sub PrintText(ByVal sender As Object, ByVal ev As PrintPageEventArgs)
Dim rect As New Rectangle(50, 75, 750,1000)
ev.Graphics.DrawString(TbxBody.Text, New Font("Courier New", 11, FontStyle.Regular), Brushes.Black, rect)
ev.HasMorePages = False
End Sub