RichTextBox

  • Thread starter Thread starter BaligaN
  • Start date Start date
B

BaligaN

Hi,

I need to read data from certain table and then save it to RTF file. I
thought up of using a RichTextBox and then "dumping" all the text into this
compoent at run time and use the "SaveFile" method. However, I would have to
"manipulate" the text that goes in to the rich text box. For exmable, I
would have to make certain text bold or appear in another column / row. Can
anyone suggest me a good way to acheive this please?

regards
Baliga
 
Hi,

I need to read data from certain table and then save it to RTF file. I
thought up of using a RichTextBox and then "dumping" all the text into this
compoent at run time and use the "SaveFile" method. However, I would have to
"manipulate" the text that goes in to the rich text box. For exmable, I
would have to make certain text bold or appear in another column / row. Can
anyone suggest me a good way to acheive this please?

regards
Baliga

Hi,

Since there isn't any RTF manipulation tool other than RichTextBox
in .NET (Not that I know of), I would suggest to do exactly what you
said: Pass the text into the RTB, manipulate the text and then save
the RTF text using the SaveFile method.

To manipulate text (bold for example) you should select the text to be
manipulated and use the Selection* methods.

rtb1.SelectionStart = 0;
rtb1.SelectionLength = 2;
rtb1.SelectionColor = Color.Blue;

Hope this helps.
Moty
 
Back
Top