Skip to main content

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.v24.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

[DefaultValue(false)]
[DXCategory("Text")]
[XtraSerializableProperty]
public virtual bool AllowHtmlStringInCaption { get; set; }

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.

Example

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