Back to Devexpress

BarItem.Enabled Property

windowsforms-devexpress-dot-xtrabars-dot-baritem-9ebd1edb.md

latest6.7 KB
Original Source

BarItem.Enabled Property

Determines whether the current BarItem is active.

Namespace : DevExpress.XtraBars

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DefaultValue(true)]
[DXCategory("Behavior")]
public virtual bool Enabled { get; set; }
vb
<DefaultValue(True)>
<DXCategory("Behavior")>
Public Overridable Property Enabled As Boolean

Property Value

TypeDefaultDescription
Booleantrue

true if the current BarItem is enabled; otherwise, false.

|

Remarks

If a specific BarItem is enabled, then its icon and caption appear in full color: and the item can be clicked to perform specific actions. If it is disabled, then its icon and caption appear shaded: and it cannot be clicked.

The following code snippets (auto-collected from DevExpress Examples) contain references to the Enabled 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-dashboard-display-each-series-in-separate-pane-for-chart-items/CS/MultiPaneExtension/MultiPaneModule.cs#L157

csharp
enableBarItem.Checked = showTitlesBarItem.Checked = allowCollapsingBarItem.Checked = false;
enableBarItem.Enabled = showTitlesBarItem.Enabled =
    allowCollapsingBarItem.Enabled = layoutModeBarItem.Enabled = false;

connect-winforms-grid-to-dotnetcore-service-enable-pbac/CS/WinForms.Client/MainForm.cs#L107

csharp
userIsWriter = true;
addItemButton.Enabled = true;
deleteItemButton.Enabled = true;

winforms-spreadsheet-implement-microsoft-excel-format-painter/CS/WindowsFormsApplication1/FormatPainterProvider.cs#L85

csharp
{
    biFormatPainter.Enabled = false;
    biFormatPainter.Checked = false;

connect-winforms-grid-to-backend-using-middletier-server/CS/WinForms.Client/MainForm.cs#L39

csharp
this.securedObjectSpace = middleTierClient.CreateObjectSpace();
this.bbiNew.Enabled = middleTierClient.Security.CanCreate<Employee>(securedObjectSpace);
this.bbiEdit.Enabled = middleTierClient.Security.CanWrite<Employee>(securedObjectSpace);

winforms-overlay-form-display-custom-button/CS/Form1.cs#L40

csharp
async void OnRunTaskItemClick(object sender, ItemClickEventArgs e) {
    biRunTask.Enabled = false;
    string taskResult;

winforms-dashboard-display-each-series-in-separate-pane-for-chart-items/VB/MultiPaneExtension/MultiPaneModule.vb#L135

vb
layoutModeBarItem.Enabled = False
allowCollapsingBarItem.Enabled = layoutModeBarItem.Enabled
showTitlesBarItem.Enabled = allowCollapsingBarItem.Enabled

winforms-spreadsheet-implement-microsoft-excel-format-painter/VB/WindowsFormsApplication1/FormatPainterProvider.vb#L75

vb
If spreadsheetControl.SelectedShape IsNot Nothing OrElse spreadsheetControl.SelectedComment IsNot Nothing Then
    biFormatPainter.Enabled = False
    biFormatPainter.Checked = False

connect-winforms-grid-to-backend-using-middletier-server/VB/WinForms.Client/MainForm.vb#L28

vb
gridView.FocusRectStyle = Views.Grid.DrawFocusRectStyle.RowFocus
bbiNew.Enabled = RemoteContextUtils.IsGranded(GetType(Employee), SecurityOperations.Create)
bbiDelete.Enabled = RemoteContextUtils.IsGranded(GetType(Employee), SecurityOperations.Delete)

winforms-overlay-form-display-custom-button/VB/Form1.vb#L43

vb
Private Async Sub OnRunTaskItemClick(ByVal sender As Object, ByVal e As ItemClickEventArgs)
    biRunTask.Enabled = False
    Dim taskResult As String

winforms-spreadsheet-use-custom-cell-editors/VB/DevAVInvoicing/Form1.vb#L109

vb
Dim invoiceItems As DefinedName = sheet.DefinedNames.GetDefinedName("InvoiceItems")
    btnRemoveRecord.Enabled = invoiceItems IsNot Nothing AndAlso invoiceItems.Range.RowCount > 1 AndAlso invoiceItems.Range.IsIntersecting(sheet.SelectedCell)
Else

See Also

BarItem Class

BarItem Members

DevExpress.XtraBars Namespace