How do include read-only formatted multi-line text in a windows form?
I have a splash screen with multi-line text with minimal formatting (font size, font color, superscript, unerline).
How do I create a dialog with this multi-l开发者_JS百科ine text with formatting?Create a Windows form that is and open it modally. If you need to know what the user clicked you can have it return a DialogResult value. You can display multiple line of text using either a Textbox and set the Readonly property to true or using a Label control. Both a Textbox and a Label have a Multiline property that you can set to true to allow multiple lines of text.
How is the text formatted? HTML? RTF? Or is that up to you?
Is the text static, or dynamic?
For no formatting, use a single label or multiple label controls. You can also use multiple label controls if you have completely separate labels that need different formatting.
For no formatting with a large amount of text that may wrap off the screen, use a read-only multi-line text box with a scrollbar.
For rich text, use a RichTextBox.
For HTML, drop in a WebBrowser control.
If you need formatted text, use a RichTextBox
Control, with both ReadOnly = true;
and Multiline = true;
Note that it's probably easier to make an RTF file that looks like you want it, then use RichTextBox's RichTextBbx1.LoadFile("path\to\file");
精彩评论