Rias
asked on
Richtextbox formatting
Hello,
How can I format text in the richtextbox.
I am using vb.net 2014 windows.
Need to make text bold and change font on some words.
Cheers
How can I format text in the richtextbox.
I am using vb.net 2014 windows.
Need to make text bold and change font on some words.
Cheers
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Also look at
https://en.wikipedia.org/wiki/Rich_Text_Format
There is an example where the font is specified.
ps. Rtf format AFAIK isn't going to be further developed, it seems like HTML formats are replacing it.
https://en.wikipedia.org/wiki/Rich_Text_Format
There is an example where the font is specified.
ps. Rtf format AFAIK isn't going to be further developed, it seems like HTML formats are replacing it.
>>Where do I add this code?
eg. FormLoad event, the rtf textbox needs to have been created when you specify the formatted text. Note you need to use the Rtf property not the Text property. The Rtf displays the formatted text according to the string, the Text property just treats it as a string without displaying any formatting.
eg. FormLoad event, the rtf textbox needs to have been created when you specify the formatted text. Note you need to use the Rtf property not the Text property. The Rtf displays the formatted text according to the string, the Text property just treats it as a string without displaying any formatting.
ASKER
Cheers mate!
ASKER
Andy,
How can I add new line and a picture to it?
Cheers
How can I add new line and a picture to it?
Cheers
New line is \r\n
Picture - I don't know offhand. What you could do is open winword, put a picture in then save the document as rtf. Inspect the file you saved with notepad (which does not format the file in the editor window).
Picture - I don't know offhand. What you could do is open winword, put a picture in then save the document as rtf. Inspect the file you saved with notepad (which does not format the file in the editor window).
ASKER
Cool Andy ,will try!
ASKER
Where do I add this code?