HtmlRenderer.HtmlLabel
System.Windows.Forms.Control
You can use it just as an HTML container, just place the label on a form and feed the
Text
property with HTML code.
Try the Sample Form to play with html label control.Properties
Bridge - used to resolve external references in html code (property, method calls)
BaseStylesheet - Set base stylesheet to be used by html rendered in the control.
AutoSize - Automatically sets the size of the label by content size
AutoSizeHeightOnly - Automatically sets the height of the label by content height (width is not effected).
MaximumSize - Gets or sets the max size the control get be set by AutoSize or AutoSizeHeightOnly.
MinimumSize - Gets or sets the min size the control get be set by AutoSize or AutoSizeHeightOnly.
Text - Gets or sets the HTML source for rendering.
Methods
GetHtml() - Get html from the current DOM tree with inline style.
Events
LinkClicked - Raised when the user clicks on a link in the html, Allows canceling the execution of the link.
RenderError - Raised when an error occured during html rendering.
ImageLoad - Raised when an image is about to be loaded by file path or URI. This event allows to provide the image manually, if not handled the image will be loaded from file or download from URI.
Differences between HtmlPanel and HtmlLabel
- HtmlPanel has scrollbars support
- HtmlLabel can be autosized
- HtmlLabel can have transparent background