Back to Devexpress

LayoutControlItem.AllowHtmlStringInCaption Property

windowsforms-devexpress-dot-xtralayout-dot-layoutcontrolitem-34eac002.md

latest3.3 KB
Original Source

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

NuGet Package : DevExpress.Win.Navigation

Declaration

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

Property Value

TypeDefaultDescription
Booleanfalse

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.

csharp
layoutControlItem1.Text = "<size=14>Size = 14 <u>Underline</u> 
 <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;
vb
LayoutControlItem1.Text = "<size=14>Size = 14 <u>Underline</u> 
 <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

Text

HyperlinkClick

HTML-inspired Text Formatting

LayoutControlItem Class

LayoutControlItem Members

DevExpress.XtraLayout Namespace