User Rating: 3 / 5

Star ActiveStar ActiveStar ActiveStar InactiveStar Inactive
 

CheckBox Control [System.Windows.Forms.CheckBox]

Represents a Windows check box control.

Default Event: CheckedChanged

Why use the CheckBox control?

Use the CheckBox control to retrieve or display True / False values.

 

Important Properties:

Checked

Indicates whether the checkbox is in the checked state.

Values (Default: False):

True

 Checked

 

False

Unchecked

Set the Checked property in the editor:

$checkbox1.Checked =$true

 

CheckAlign

Determines the location of the checkbox inside the control.

Why use the CheckAlign property? 

Use the CheckAlign property when you want to change the location of the check box in respect to the control’s space.

Values (Default: MiddleLeft):

TopLeft
Content is vertically aligned at the top and horizontally aligned on the left.

TopLeft

 

TopCenter
Content is vertically aligned at the top and horizontally aligned at the center.

TopCenter

 

TopRight
Content is vertically aligned at the top and horizontally aligned on the right.

TopRight

 

MiddleLeft
Content is vertically aligned in the middle and horizontally aligned on the left.

MiddleLeft

 

MiddleCenter
Content is vertically aligned in the middle and horizontally aligned at the center.

MiddleCenter

 

MiddleRight
Content is vertically aligned in the middle and horizontally aligned on the right.

MiddleRight

 

BottomLeft
Content is vertically aligned at the bottom and horizontally aligned on the left.

BottomLeft

 

BottomCenter
Content is vertically aligned at the bottom and horizontally aligned at the center.

BottomCenter

 

BottomRight
Content is vertically aligned at the bottom and horizontally aligned on the right.

BottomRight

 

TextAlign

The alignment of the text that will be displayed on the control.

Values (Default: MiddleLeft):

Shares the same values as CheckAlign property.

 

Important Events:

CheckedChanged

Occurs whenever the Check property is changed.

Why use the CheckedChanged event?

Use the CheckedChanged event when you wish to respond to when a user changes the check box state by modifying the form controls or running a script . For example, you may wish to disable certain controls depending on the checkbox’s current value.

In this example,  the event script disables the input textboxes for UserName and Password when the “Use Alternate Credentials” checkbox is unchecked.

$checkboxUseAltCred_CheckedChanged={
    #Enable or Disable the TextBox controls
    $textboxUserName.Enabled = $checkboxUseAltCred.Checked
    $textboxPassword.Enabled = $checkboxUseAltCred.Checked
}

When the checkbox is unchecked, the textboxes are disabled:

OnCheckedChanged Unchecked

When the checkbox is checked, the textboxes are enabled:

OnCheckedChanged Checked

If you have questions about our products, please post in our support forum.
For licensed customers, use the forum associated with your product in our Product Support Forums for Registered Customers.
For users of trial versions, please post in our Former and Future Customers - Questions forum.
Copyright © 2024 SAPIEN Technologies, Inc.