Hello,
Can I use rich text box to display and print reports. My problem is I don't know how to add text to RTF Box at runtime using different fonts and colors and at a particular line.
For example, at runtime If I do something like this:
rtf.Font.Size = 15
rtf.Text = "Hello"
rtf.Font.Name = "Arial"
rtf.Font.Size = 20
rtf.Text = rtf.Text & " How"
Then both words are displayed using Size 20 and font arial. But I wanted that only second word
should be of size 20 and font "Arial".
I want to retrieve record from a database and then display information contained in a record's fields one by one and line by line but using different fonts and colors.
For example, If want to create a report to display employee records and I want that employee name should be Bold and centred, other fields should use different color, indentation etc. I need a way to go a particular row and particular column and then write text there and change only that text's font and colors etc. and then go to next row, write other information and change text attributes of that line and so on.
I cannot add text to rtf directly. So I need a way where when I add more text, formatting of old text of rtf box doesn't change.
For example if I do rtf.text = rtf.text+"Hello" than I don't want that properties of text (fonts, colors
etc) which is already there in rtf.text does change.
So main problem is going to a particular line/column, add text and then change font etc of added text only and that too at runtime.
How can I achieve it when entering text using code at runtime?
Can I use rich text box to display and print reports. My problem is I don't know how to add text to RTF Box at runtime using different fonts and colors and at a particular line.
For example, at runtime If I do something like this:
rtf.Font.Size = 15
rtf.Text = "Hello"
rtf.Font.Name = "Arial"
rtf.Font.Size = 20
rtf.Text = rtf.Text & " How"
Then both words are displayed using Size 20 and font arial. But I wanted that only second word
should be of size 20 and font "Arial".
I want to retrieve record from a database and then display information contained in a record's fields one by one and line by line but using different fonts and colors.
For example, If want to create a report to display employee records and I want that employee name should be Bold and centred, other fields should use different color, indentation etc. I need a way to go a particular row and particular column and then write text there and change only that text's font and colors etc. and then go to next row, write other information and change text attributes of that line and so on.
I cannot add text to rtf directly. So I need a way where when I add more text, formatting of old text of rtf box doesn't change.
For example if I do rtf.text = rtf.text+"Hello" than I don't want that properties of text (fonts, colors
etc) which is already there in rtf.text does change.
So main problem is going to a particular line/column, add text and then change font etc of added text only and that too at runtime.
How can I achieve it when entering text using code at runtime?