windowsforms-devexpress-dot-xtraeditors-dot-repository-dot-repositoryitem-0a7dca90.md
Gets or sets whether HTML tags can be used to format an editor’s text or text of the editor’s items.
Namespace : DevExpress.XtraEditors.Repository
Assembly : DevExpress.XtraEditors.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
[DefaultValue(DefaultBoolean.Default)]
[DXCategory("Behavior")]
public virtual DefaultBoolean AllowHtmlDraw { get; set; }
<DXCategory("Behavior")>
<DefaultValue(DefaultBoolean.Default)>
Public Overridable Property AllowHtmlDraw As DefaultBoolean
| Type | Default | Description |
|---|---|---|
| DefaultBoolean | Default |
A DefaultBoolean value that specifies whether HTML tags can be used to format an editor’s text or text of the editor’s items.
|
Available values:
| Name | Description | Return Value |
|---|---|---|
| True |
The value is true.
|
0
| | False |
The value is false.
|
1
| | Default |
The value is specified by a global option or a higher-level object.
|
2
|
If the AllowHtmlDraw property is set to True , you can use HTML tags to format an editor’s text or the text of the editor’s items. For detailed information, see HTML Text Formatting.
Note
The AllowHtmlDraw property is not supported by all editors. For ButtonEdit descendants, the property is supported when text editing is disabled (the RepositoryItemButtonEdit.TextEditStyle property is set to TextEditStyles.DisableTextEditor).
For a list of editors supported this property, see HTML Text Formatting.
The following example shows how to format the BaseCheckEdit.Text using HTML tags. HTML formatting is enabled via the RepositoryItem.AllowHtmlDraw property. The image below shows the result:
checkEdit1.Text = "<size=14>Size = 14
<b>Bold</b> <i>Italic</i>
<u>Underline</u>
<size=11>Size = 11
<color=255, 0, 0>Sample Text";
checkEdit1.Properties.AllowHtmlDraw = DefaultBoolean.True;
checkEdit1.Properties.Appearance.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap;
checkEdit1.Properties.Appearance.Options.UseTextOptions = true;
checkEdit1.Text = "<size=14>Size = 14
<b>Bold</b> <i>Italic</i> <u>Underline</u> " + _
"
<size=11>Size = 11
<color=255, 0, 0>Sample Text"
checkEdit1.Properties.AllowHtmlDraw = DefaultBoolean.True
checkEdit1.Properties.Appearance.TextOptions.WordWrap = DevExpress.Utils.WordWrap.Wrap
checkEdit1.Properties.Appearance.Options.UseTextOptions = True
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the AllowHtmlDraw property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-grid-display-icons-in-data-cells/VB/Form1.vb#L186
buttonEdit.TextEditStyle = TextEditStyles.DisableTextEditor
buttonEdit.AllowHtmlDraw = DevExpress.Utils.DefaultBoolean.True
Dim collection = New DevExpress.Utils.ImageCollection()
See Also