Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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.2.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