Class ToolStripCheckBox
ToolStripCheckBox class, that represents checkbox item on ToolStrip.
Namespace: Syncfusion.Windows.Forms.Tools
Assembly: Syncfusion.Tools.Windows.dll
Syntax
public class ToolStripCheckBox : ToolStripButton
Constructors
ToolStripCheckBox()
Constructor of the ToolStripCheckBox.
Declaration
public ToolStripCheckBox()
Properties
BackColor
Gets or sets the background color for the item.
Declaration
public override Color BackColor { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Color | A System.Drawing.Color that represents the background color of the item. The default is the value of the System.Windows.Forms.Control.DefaultBackColor property. |
BackgroundImage
Gets or sets the background image displayed in the item.
Declaration
public override Image BackgroundImage { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Image | An System.Drawing.Image that represents the image to display in the background of the item. |
BackgroundImageLayout
Gets or sets the background image layout used for the System.Windows.Forms.ToolStripItem.
Declaration
public override ImageLayout BackgroundImageLayout { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Forms.ImageLayout | One of the System.Windows.Forms.ImageLayout values. The default value is System.Windows.Forms.ImageLayout.Tile. |
CheckAlign
Gets or sets the horizontal and vertical alignment of the check mark on a ToolStripCheckBox control.
Declaration
public ContentAlignment CheckAlign { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.ContentAlignment | One of the System.Drawing.ContentAlignment values. The default value is MiddleLeft. |
Exceptions
Type | Condition |
---|---|
System.ComponentModel.InvalidEnumArgumentException | The value assigned is not one of the System.Drawing.ContentAlignment enumeration values. |
CheckedImage
Gets/Sets the value for displaying the image or not in checked state.
Declaration
public Image CheckedImage { get; set; }
Property Value
Type |
---|
System.Drawing.Image |
CheckOnClick
This property is not used, because ToolStripCheckBox automatically appears pressed in and not pressed in when clicked.
Declaration
public bool CheckOnClick { get; set; }
Property Value
Type |
---|
System.Boolean |
DisplayStyle
Gets or sets whether text and images are displayed on a ToolStripCheckBox.
Declaration
public ToolStripItemDisplayStyle DisplayStyle { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Forms.ToolStripItemDisplayStyle | One of the System.Windows.Forms.ToolStripItemDisplayStyle values. The default is System.Windows.Forms.ToolStripItemDisplayStyle.ImageAndText. |
Font
Gets or sets the System.Drawing.Font value for the ToolStripCheckBox .
Declaration
public override Font Font { get; set; }
Property Value
Type |
---|
System.Drawing.Font |
ForeColor
Gets or sets the foreground color of the item.
Declaration
public override Color ForeColor { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Color | The foreground System.Drawing.Color of the item. The default is the value of the System.Windows.Forms.Control.DefaultForeColor property. |
Image
Gets or sets the image that is displayed on a ToolStripCheckBox.
Declaration
public override Image Image { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Image | The System.Drawing.Image to be displayed. |
ImageAlign
Gets or sets the alignment of the image on a ToolStripCheckBox.
Declaration
public ContentAlignment ImageAlign { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.ContentAlignment | One of the System.Drawing.ContentAlignment values. The default is System.Drawing.ContentAlignment.MiddleLeft. |
ImageCheckBox
Gets/Sets the value for displaying the image or not in checked state.
Declaration
public bool ImageCheckBox { get; set; }
Property Value
Type |
---|
System.Boolean |
ImageCheckBoxSize
Gets/Sets the value for size of the displaying the image in checked state.
Declaration
public Size ImageCheckBoxSize { get; set; }
Property Value
Type |
---|
System.Drawing.Size |
ImageScaling
Gets or sets a value indicating whether an image on a ToolStripCheckBox is automatically resized to fit in a container.
Declaration
public ToolStripItemImageScaling ImageScaling { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Forms.ToolStripItemImageScaling | One of the System.Windows.Forms.ToolStripItemImageScaling values. The default is System.Windows.Forms.ToolStripItemImageScaling.SizeToFit. |
ImageTransparentColor
Gets or sets the color to treat as transparent in a ToolStripCheckBox image.
Declaration
public Color ImageTransparentColor { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Color | One of the System.Drawing.Color values. |
RightToLeftAutoMirrorImage
Mirrors automatically the ToolStripCheckBox image when the System.Windows.Forms.ToolStripItem.RightToLeft property is set to System.Windows.Forms.RightToLeft.Yes.
Declaration
public bool RightToLeftAutoMirrorImage { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true to automatically mirror the image; otherwise, false. The default is false. |
TextDirection
Gets the orientation of text used on a ToolStripCheckBox.
Declaration
public override ToolStripTextDirection TextDirection { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Forms.ToolStripTextDirection | One of the System.Windows.Forms.ToolStripTextDirection values. |
TextImageRelation
Gets or sets the position of ToolStripCheckBox text and image relative to each other.
Declaration
public TextImageRelation TextImageRelation { get; set; }
Property Value
Type | Description |
---|---|
System.Windows.Forms.TextImageRelation | One of the System.Windows.Forms.TextImageRelation values. The default is System.Windows.Forms.TextImageRelation.ImageBeforeText. |
ThreeState
Gets or sets a value indicating whether the ToolStripCheckBox will allow three check states rather than two.
Declaration
public bool ThreeState { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the ToolStripCheckBox is able to display three check states; otherwise, false. The default value is false. |
Methods
GetButtonBackgroundRect(ToolStripItem, Rectangle)
Declaration
protected Rectangle GetButtonBackgroundRect(ToolStripItem item, Rectangle rc)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.ToolStripItem | item | |
System.Drawing.Rectangle | rc |
Returns
Type |
---|
System.Drawing.Rectangle |
GetPreferredSize(Size)
Retrieves the size of a rectangular area into which a control can be fit.
Declaration
public override Size GetPreferredSize(Size constrainingSize)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Size | constrainingSize | The custom-sized area for a control. |
Returns
Type | Description |
---|---|
System.Drawing.Size | A System.Drawing.Size ordered pair, representing the width and height of a rectangle. |
OnClick(EventArgs)
Declaration
protected override void OnClick(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
OnLayout(LayoutEventArgs)
Declaration
protected override void OnLayout(LayoutEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.LayoutEventArgs | e |
OnPaint(PaintEventArgs)
Declaration
protected override void OnPaint(PaintEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.PaintEventArgs | e |
OnRightToLeftChanged(EventArgs)
Declaration
protected override void OnRightToLeftChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |