CheckBox.Checked Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets a value indicating whether the CheckBox control is checked.
public:
virtual property bool Checked { bool get(); void set(bool value); };
[System.ComponentModel.Bindable(true)]
public virtual bool Checked { get; set; }
[System.ComponentModel.Bindable(true, System.ComponentModel.BindingDirection.TwoWay)]
[System.Web.UI.Themeable(false)]
public virtual bool Checked { get; set; }
[]
member this.Checked : bool with get, set
[]
[]
member this.Checked : bool with get, set
Public Overridable Property Checked As Boolean
Property Value
true to indicate a checked state; otherwise, false. The default is false.
Implements
- Attributes
Examples
The following example demonstrates how to use the Checked property to determine the state of the CheckBox control.
Note
The following code sample uses the single-file code model and may not work correctly if copied directly into a code-behind file. This code sample must be copied into an empty text file that has an .aspx extension. For more information on the Web Forms code model, see ASP.NET Web Forms Page Code Model.
<%@ Page Language="C#" AutoEventWireup="True" %>
CheckBox CheckedChanged Example
<%@ Page Language="VB" AutoEventWireup="True" %>
CheckBox CheckedChanged Example
Remarks
Use this property to determine whether the CheckBox control is checked. This property can also be used to programmatically set the state of the CheckBox control.
This property cannot be set by themes or style sheet themes. For more information, see ThemeableAttribute and ASP.NET Themes and Skins.