Jul 16
It’s easy to display an RTF file — that was embedded as a resource in a C# program — in a Windows Form RichTextControl.
First, include the following references:
using System.IO; using System.Reflection;
Next, load the RTF that you have embedded in your Visual Studio project:
Assembly asm = Assembly.GetExecutingAssembly(); Stream stream = asm.GetManifestResourceStream( "MyNamespace.FileName.rtf" ); RichTextBox rt = new RichTextBox(); rt.LoadFile( stream, RichTextBoxStreamType.RichText );
The trickiest part of loading an embedded resource is getting the correct path. Check out this article if you are having trouble loading the embedded resource.
Copyright © 2007-8 Tiwebb Ltd. All rights reserved. This material may not be published, broadcast, rewritten or redistributed without explicit permission from Tiwebb Ltd.

