Gets or sets a value indicating whether this Button is checked.

Namespace:  ESRI.ArcGIS.Desktop.AddIns

Assembly:  ESRI.ArcGIS.Desktop.Addins (in ESRI.ArcGIS.Desktop.Addins.dll) Version: 10.0.0.0 (10.0.0.0)

Syntax

C#
protected bool Checked { get; set; }
Visual Basic (Declaration)
Protected Property Checked As Boolean
Visual C++
protected:
property bool Checked {
	bool get ();
	void set (bool value);
}

Field Value

trueTruetruetrue (True in Visual Basic) if checked; otherwise, falseFalsefalsefalse (False in Visual Basic).

Remarks

The Checked property indicates the state of this button. If a button appears depressed on a toolbar, the button is checked.

Examples

The example code below shows a very simple button class that shows a dockable window.
CopyC#
public ToggleDockWndBtn() 
{
  this.Checked = true;
}

protected override void OnClick()
{
  //Get dockable window.
  UID dockWinID = new UIDClass();
  dockWinID.Value = @"esriArcMapUI.TOCDockableWindow";
  IDockableWindow dockWindow = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID);
  dockWindow.Show(!dockWindow.IsVisible());
}

protected override void OnUpdate()
{
  this.Enabled = m_mainExtension.IsExtensionEnabled;
}
CopyVB.NET
Public Sub New()
  Me.Checked = True
End Sub

Protected Overloads Overrides Sub OnClick()
  'Get dockable window. 
  Dim dockWinID As UID = New UIDClass()
  dockWinID.Value = "esriArcMapUI.TOCDockableWindow"
  Dim dockWindow As IDockableWindow = ArcMap.DockableWindowManager.GetDockableWindow(dockWinID)
  dockWindow.Show(Not dockWindow.IsVisible())
End Sub

Protected Overloads Overrides Sub OnUpdate()
  Me.Enabled = m_mainExtension.IsExtensionEnabled
End Sub

See Also