windowsforms-devexpress-dot-xtraeditors-dot-repository-dot-repositoryitem-975a20e5.md
Gets or sets a value specifying whether the focus rectangle is displayed within the editor when it has focus.
Namespace : DevExpress.XtraEditors.Repository
Assembly : DevExpress.XtraEditors.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
[DefaultValue(true)]
[DXCategory("Appearance")]
public virtual bool AllowFocused { get; set; }
<DXCategory("Appearance")>
<DefaultValue(True)>
Public Overridable Property AllowFocused As Boolean
| Type | Default | Description |
|---|---|---|
| Boolean | true |
true if the focus rectangle is displayed when the editor has focus; otherwise, false.
|
The editor cannot be focused if it is disabled.
Changing the AllowFocused property value raises the RepositoryItem.PropertiesChanged event.
For focused standalone ButtonEdit controls and their descendants, focus is indicated by a dotted frame, provided that the AllowFocused property is set to true and the RepositoryItemButtonEdit.TextEditStyle property is set to TextEditStyles.DisableTextEditor. In other cases, no dotted focus frame is painted.
Note
This property is in effect only for stand-alone editors. If you use the editor in a data-aware control (Data Grid, Vertical Grid, Tree List, etc.), this property is ignored. Use related settings of the data-aware control instead (for example, the TreeListOptionsView.FocusRectStyle property).
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the AllowFocused 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-editors-in-columns-headers/CS/WindowsApplication1/Form1.cs#L38
RepositoryItemCheckEdit riCheckEdit = new RepositoryItemCheckEdit();
riCheckEdit.AllowFocused = false;
riCheckEdit.EditValueChanged += new EventHandler(riCheckEdit_EditValueChanged);
winforms-grid-display-editors-in-columns-headers/VB/Form1.vb#L37
Dim riCheckEdit As New RepositoryItemCheckEdit()
riCheckEdit.AllowFocused = False
AddHandler riCheckEdit.EditValueChanged, AddressOf riCheckEdit_EditValueChanged
See Also