LayoutControlItem.AllowHtmlStringInCaption Property

Gets or sets whether HTML formatting is allowed in the text that is associated with the layout item.

Namespace: DevExpress.XtraLayout

Assembly: DevExpress.XtraLayout.v20.1.dll

Declaration

[XtraSerializableProperty]
[DefaultValue(false)]
[DXCategory("Text")]
public virtual bool AllowHtmlStringInCaption { get; set; }
<XtraSerializableProperty>
<DefaultValue(False)>
<DXCategory("Text")>
Public Overridable Property AllowHtmlStringInCaption As Boolean

Property Value

Type Default Description
Boolean

false

true if HTML formatting is allowed; otherwise, false.

Remarks

If the AllowHtmlStringInCaption property is set to true, you can use HTML tags to format the BaseLayoutItem.Text. For detailed information see HTML Text Formatting.

HTML formatting isn't supported when the XtraLayout is printed or exported. HTML tags aren't displayed in a printed document.

Examples

The following example shows how to format the BaseLayoutItem.Text using HTML tags. HTML formatting is enabled via the LayoutControlItem.AllowHtmlStringInCaption property.

layoutItem_HTML_formatting

layoutControlItem1.Text = "<size=14>Size = 14 <u>Underline</u> <br> <size=11>Size = 11 <color=255, 0, 0>Red";
layoutControlItem1.AllowHtmlStringInCaption = true;
// Increase the control's height
layoutControlItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
layoutControlItem1.MinSize = new Size(layoutControlItem1.MinSize.Width, 50);
layoutControlItem1.AppearanceItemCaption.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap;
See Also