Click here to Skip to main content
15,887,676 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
please i need your help i have problem in my project
when i try print from textbox or ritchTextBox the words in one line
no go to 2nd line and go outside of paper
i want stop in certain point and go next line without cutting word

can you help me please?

What I have tried:

i want words go to next line if line is full
Posted
Updated 9-Apr-21 7:30am

1 solution

It depends on how you are printing it: if you use a PrintDocument, then you have full control over how and where everything in printed.
And some of the Graphics.DrawString overloads allow you to specify the Rectangle in which the text is printed: Graphics.DrawString Method (System.Drawing) | Microsoft Docs[^]
Specifying the rectangle gives "limits" to the box in which the print happens, and word wrap will happen automatically, just as it does in a multiline text box.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900