[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 198
  • Last Modified:

C# how to print from my app?

C#

I have added a nav bar to my small GUI app and added the word print - how do I make it print to whatever is the default printer? Code appreciated. Looking for simple and best way.

Karl66
0
Karl66
Asked:
Karl66
  • 3
  • 2
2 Solutions
 
Bob LearnedCommented:
What do you want to print?

Bob
0
 
Karl66Author Commented:
A Text window that displays the output based on user generated button clicks. A "general" print function as in "hey they clicked print" so print the richtext1 window or whatever I am currently having them interface with...

Thx,
Karl66
0
 
Bob LearnedCommented:
Do you need to create a form with PrintPreview and a PrintDocument?

Bob
0
 
Karl66Author Commented:
Basically I search a database and dump the results of a sql query to a text box richTextBox1 and then have added a print option in the navigation bar drop down under file. When selected I would like it to print the richTextBox1 contents. However this is done ... I have some googled ideas but I cannot imagine it should be that complex... i.e. :

print.richTextBox1()
0
 
Bob LearnedCommented:
Well, my friend, you are wrong, because it will be that complex.  There isn't any one line method call that will get the job done.  You are going to have to search for printing with the RichTextBox control.

Start here:

How to print the content of a RichTextBox control by using Visual C# .NET or Visual C# 2005
http://support.microsoft.com/kb/812425

Bob
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now