StrataFrame Forum

Populating RichTextBox content

http://forum.strataframe.net/Topic3735.aspx

By Chris Crabtree - 10/20/2006

Working on an idea with a wizard with some fairly complicated individual steps. I need to provide the user some explanation on each form, and would ideally do this using RTF where I can apply some formatting to the explanation, etc. I've been down the road of storing this kind of thing in individual RTF files on the client and loading the appropriate file at the appropriate time, but it seems kind of a kludge to do that when there is nice support in the framework for messaging lookups by key.

Can I use the Messaging & Localization stuff to store the RTF and pipe it into the RichTextBox at runtime by key?

Or is it just going to give me plain old text with no rich markup?

Thanks!

By Trent L. Taylor - 10/20/2006

Well there are a number of ways to do this.  There are two types of localization items: messages and text values.  All messages are RTF and maintain the formatting.  They are generally used for message box items.  But you can use them in this context as well.  For example, you can create a message and pull it from the localization database like this:

MyRTFControl.RTF = MicroFour.StrataFrame.UI.Localization.RetrieveMessage("MyMessageKey").Text

This would allow you to use the localization interface and still keep the RTF formatting. 

You can also bind our RTF control directly to a field in a table that has the RTF data as well.  Let me know if this does not answer your question.