vb.netvisual-studio.net-2.0richtextboxdesign-time

Is it possible to style text in a richtextbox at design time?


I have a System.Windows.Forms.RichTextBox that I wish to use to display some instructions to my application users.

Is it possible to set some of the text I enter at designtime to be bold?

Or do I have no option but to do it at runtime?


Solution

  • You can certainly create an RTF document in RTF editor (e.g. WordPad), save the file, open it as a text/plain file and copy the RTF document into the RtfText property of your RichTextBox at design time.

    But I advise against it. That way, you have a large amount of data in your code and there’s just no point in doing that. Use a resource, that’s what they’re there for, after all. You can bind individual resources to control properties at design time.