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.Reflection;
Assembly assembly = Assembly.GetExecutingAssembly();
using (Stream stream =
assembly.GetManifestResourceStream("RTFtest.testFi le.rtf"))
{
richTextBox.LoadFile(stream, RichTextBoxStreamType.RichText);
}
where 'RTFtest' is the default namespace for the project.
- Magnus
"Tank" <an*******@discussions.microsoft.com> wrote in message
news:uI**************@tk2msftngp13.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.