Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How do I put columns in a RichTextBox during runtime?
Posted

Your definition of "columns" needs to be specified. What are you trying to do with them??

Are you talking about newspaper style columns? DataGridView style? Tab stops?? What...
 
Share this answer
 
Comments
Terence Jonkers 29-Feb-12 10:53am    
Maybe I posted the question wrong. I want to put a table like the ones being used in Microsoft Office Word in it and then use different alignments in each column of the table. I would really appreciate it if you can help me with this.
Dave Kreskowiak 29-Feb-12 16:46pm    
There is no support to do it directly. It can, however, be done. You'll have to add the RTF table markup to the RTFText property of the RichTextBox. It's ugly and a bit confusing. If you want to see what it takes, create a table in a Word document, then save the document as RichTextFormat. You can load that into the RichTextBox to make sure it looks right. All you have to do then is open the document file in Notepad and examine the markup code.
If your purpose is to present data in tabular form in between text blocks, then you may consider using a HTML control presented in this article
A Professional HTML Renderer You Will Use[^]
as HTML markup is easy to generate programmatically.
 
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