If you want initial formatted text in a RichTextBox, we have found the following to work very well:
- Write the text in word and save as an rtf file in the resources subdirectory of your project.
- Open the file in Write and then save it. This reduces the file size a LOT.
- Add each file to the project as an embedded resource.
- Load each as follows:
protected void SetHelpPane(string filename)
{
using (Stream stream =
GetType().Assembly.GetManifestResourceStream("WindwardRePortalSystemSetup.Resources." + filename))
{
if (stream != null)
using (StreamReader sr = new StreamReader(stream, Encoding.ASCII))
{
StringBuilder sb = new StringBuilder();
string line;
while ((line = sr.ReadLine()) != null)
sb.Append(line + "\n");
rtfControl.Rtf = sb.ToString();
}
}
}
Do you find this useful? If so please check out Windward Reports.
