Image Settings in Windows Forms CheckBox (CheckBoxAdv)

29 May 20233 minutes to read

You can set the images to the CheckBoxAdv when it is in the Checked, Unchecked or Indeterminate state using ImageCheckBox,ImageCheckBoxSize,CheckedImage,UncheckedImage,IndeterminateImage,DisabledImage and StretchImage properties.

CheckBoxAdv Properties Description
ImageCheckBox Indicates whether the CheckBox will be drawn using the images provided.
ImageCheckBoxSize Gets or sets the size of the ImageCheckBox.ImageCheckbox property must be set to 'True'.
CheckedImage Gets or sets the image used to draw the CheckBox when checked and mouse not over.
UncheckedImage Gets or sets the image used to draw the CheckBox when unchecked and mouse not over.
IndeterminateImage The image used to draw the CheckBox when indeterminate and mouse not over.
DisabledImage Gets or sets the image used to draw the CheckBox when disabled.
StretchImage Indicates whether the state images of the CheckBox are stretched.

NOTE

Before setting the images, make sure the ImageCheckBox property is set to ‘True’.

this.checkBoxAdv1.ImageCheckBox = true;
this.checkBoxAdv1.ImageCheckBoxSize = new System.Drawing.Size(15, 15);
this.checkBoxAdv1.CheckedImage = ((System.Drawing.Image)(resources.GetObject("checkBoxAdv1.CheckedImage")));

this.checkBoxAdv1.UncheckedImage = ((System.Drawing.Image)(resources.GetObject("checkBoxAdv1.UncheckedImage")));
this.checkBoxAdv1.IndeterminateImage = ((System.Drawing.Image)(resources.GetObject("checkBoxAdv1.IndeterminateImage")));
this.checkBoxAdv1.DisabledImage = ((System.Drawing.Image)(resources.GetObject("checkBoxAdv1.DisabledImage")));
this.checkBoxAdv1.StretchImage = false;
Me.checkBoxAdv1.ImageCheckBox = True
Me.checkBoxAdv1.ImageCheckBoxSize = New System.Drawing.Size(15, 15)
Me.checkBoxAdv1.CheckedImage = (CType(Resources.GetObject("checkBoxAdv1.CheckedImage"), System.Drawing.Image))

Me.checkBoxAdv1.UncheckedImage = (CType(Resources.GetObject("checkBoxAdv1.UncheckedImage"), System.Drawing.Image))
Me.checkBoxAdv1.IndeterminateImage = (CType(Resources.GetObject("checkBoxAdv1.IndeterminateImage"), System.Drawing.Image))
Me.checkBoxAdv1.DisabledImage = (CType(Resources.GetObject("checkBoxAdv1.DisabledImage"), System.Drawing.Image))
Me.checkBoxAdv1.StretchImage = False

WindowsForms CheckBox images displayed in control when it is in checked

Images displayed during Mouse Hover

You can set the image in CheckBoxAdv control when the mouse is hovered over it using MouseOverCheckedImage,MouseOverIndetermImage and MouseOverUncheckedImage properties.

CheckBoxAdv Properties Description
MouseOverCheckedImage Gets or sets the image used to draw the CheckBox when checked and mouse over.
MouseOverIndetermImage Gets or sets the image used to draw the CheckBox when indeterminate and mouse over.
MouseOverUncheckedImage Gets or sets the image used to draw the CheckBox when unchecked and mouse over.
this.checkBoxAdv1.MouseOverCheckedImage = ((System.Drawing.Image)(resources.GetObject("checkBoxAdv1.MouseOverCheckedImage")));
this.checkBoxAdv1.MouseOverIndetermImage = ((System.Drawing.Image)(resources.GetObject("checkBoxAdv1.MouseOverIndetermImage")));
this.checkBoxAdv1.MouseOverUncheckedImage = ((System.Drawing.Image)(resources.GetObject("checkBoxAdv1.MouseOverUncheckedImage")));
Me.checkBoxAdv1.MouseOverCheckedImage = (CType(Resources.GetObject("checkBoxAdv1.MouseOverCheckedImage"), System.Drawing.Image))
Me.checkBoxAdv1.MouseOverIndetermImage = (CType(Resources.GetObject("checkBoxAdv1.MouseOverIndetermImage"), System.Drawing.Image))
Me.checkBoxAdv1.MouseOverUncheckedImage = (CType(Resources.GetObject("checkBoxAdv1.MouseOverUncheckedImage"), System.Drawing.Image))

WindowsForms CheckBox images displayed during Mouse hovered on control