Hi Dave,
I am sorry that I may not understand your question exactly.
Based on my understanding, you'd like to initialize a RichTextBox with a
text stored in a resource file. If I'm off base, please feel free to let me
know.
The Rtf property of RichTextBox gets or sets the text of the RichTextBox
control, including all rich text format (RTF) codes. This property is
typically used when your are assigning RTF text from another RTF source,
such as Microsoft Word or Windows WordPad, to the control.
If you have stored the value of Rtf property of a RichTextBox contol into a
resource file, you could get the value from the resource file and then
assign it to the Rtf property of the RichTextBox control. There should be
no problem.
The following is a sample. It assumes that you have stored the RTF code in
the project's default resource file.
using System.Resources;
private void button1_Click(object sender, EventArgs e)
{
ResourceManager rm = new
ResourceManager(typeof(RichTextBoxProj.Properties.Resources));
this.richTextBox1.Rtf = rm.GetString("MyString");
}
Hope this helps.
If you have anything unclear, please feel free to let me know.
Sincerely,
Linda Liu
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.