hello everyone,
I'm trying to add text to RichTextBox control, but I want to set dynamically the font to be bold.
Whenever I'm changing the Font.Bold property it taking affect of all the data that I already inserted to tee Text property.
Please help me resolve this issue.
Thank's in advance... Lior
Siddhartha SarkarPosted Oct 10, 2008, 6:58 AM
Yeah Brother I got the picture! even I have been roaming out to find solution to a similar problem.
Depending upon your requirement there can always be a way around as yours is not a case where the user dynamically change the font style.
Howver, I guess you need to play with the rtf property of the rich textBox or depending upon your requirement you can process the RichTextBox.Text (after populating it) to give the desired effect
I am sorry as I could not help you much!
Regards,
Lior KooznitsPosted Oct 10, 2008, 6:04 AM
Hello , thank's for your response.
I got array of strings that each one of the items got the seperator ':' in the middle.
It look like this: [Text1]:[Text2].
What I actually want to do is to insert all the items to the RichTextBox.Text property but I want to write only [Text1] in bold style ( ore any aother style). What I tried is to split each item and add it to the RichTextBox.Text property using the operator + and before added [Text1] I seted RichTextBox.Font.Bold to be 'true' and before added [Text2] I seted RichTextBox.Font.Bold to 'false' and before added. It didn't work because when I ever I reset the Bold property I took effect all over the data that was Inside RichTextBox.Text .
I hope that my explanation is more clear..
Thank's again, Lior
Siddhartha SarkarPosted Oct 10, 2008, 4:44 AM
Hi Lior,
Could You please explain the situation a little elaborately? What I could make out of this is you are trying to make the text entered, bold using a button click. Is it so?
Or do u wish to achieve something else?