Is two functions are separate or is any function calling another function? could please explain this?
Which code goes to print button click method?
I have a rich text box, I want to print the contents of the rich text box.
My Problem is:
If the user click print button then it will show the preview of the contents of the rich text box then user need to select the printer and then click ok it prints the contents.
How can I implement this in VB.Net?
I attched rich text box form below.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I wrote the below code in my application.
I run the application, it directly printing without showing the print preview. It only prints the empty rich text box not the contents.
My puprpose is:
First it shows the preview and then user need to select the printer then click ok it prints the contents of the rich text box.
Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrint.Click
Try
Dim pp As PrintPreviewControl
pp = New PrintPreviewControl()
pp.Show()
PrintDocument1.Print()
Catch ex As Exception
MessageBox.Show(ex, "Error Printing", MessageBoxButtons.OK)
End Try
End Sub
Private Sub PrintDocument1_PrintPage(B
Me.rtbERG.Refresh()
Me.rtbERG.Select()
'BillView.ActiveForm.Activ
Dim bt2 As Bitmap
bt2 = New Bitmap(Me.rtbERG.Width, Me.rtbERG.Height)
'Bitmap(bt2 = New Bitmap(pnlview.Width, pnlview.Height))
Dim rt2 As Rectangle
rt2 = New Rectangle(0, 0, Me.rtbERG.Width, Me.rtbERG.Height)
bt2.SetResolution(1200, 1200)
Me.rtbERG.DrawToBitmap(bt2
e.Graphics.DrawImage(bt2, rt2)
End Sub
Business Accounts
Answer for Membership
by: amar31282Posted on 2009-03-11 at 14:01:06ID: 23862315
what you can do is make the image of the text box and then print it
The code in C# is given below hope you can convert it to vb
Select allOpen in new window