You can include the RTF file as an embedded resource and load it from
the assembly.
Add the file:
Project -> Add Existing Item
Right click on it in Solution Explorer and select:
Build Action -> Embedded Resource
Then use code like this to load it:
using System.Reflecti on;
Assembly assembly = Assembly.GetExe cutingAssembly( );
using (Stream stream =
assembly.GetMan ifestResourceSt ream("RTFtest.t estFile.rtf"))
{
richTextBox.Loa dFile(stream, RichTextBoxStre amType.RichText );
}
where 'RTFtest' is the default namespace for the project.
- Magnus
"Tank" <an*******@disc ussions.microso ft.com> wrote in message
news:uI******** ******@tk2msftn gp13.phx.gbl...
I have RichTextBox in my dialog. Currently, I am loading the content from
a file. Is there anyway to have the text 'binded' to it during compile time
? The idea is not to distribute the rtf file when installing the
application.