System.Web.UI.WebControls Namespace CheckBox Class
Initializes a new instance of the CheckBox class.
[ VB ]
Public Sub New ( )
[ C# ]
public CheckBox ( );
[ C++ ]
public: CheckBox ( );
[ JScript ]
public function CheckBox ( );
Use this constructor to initialize a new instance of the CheckBox control.
The following shows how to dynamically initialize a new instance of a CheckBox control at run time.
void makeCheckBox ( Object src, EventArgs e ) {
CheckBox myCheckBox = new CheckBox ( );
myCheckBox.Text = "Check me out";
myCheckBox.AutoPostBack = true;
placeHolder.Controls.Add ( myCheckBox );
}
Sub makeCheckBox ( src As Object, e As EventArgs )
Dim myCheckBox As New CheckBox ( )
myCheckBox.Text = "Check me out"
myCheckBox.AutoPostBack = true
placeHolder.Controls.Add ( myCheckBox )
End Sub |
|
C# |
VB |
Show me
CheckBox Members