Image Settings in Windows Forms Radio Button (RadioButtonAdv)

29 Apr 20212 minutes to read

The image settings of the RadioButtonAdv control have been discussed in this section.

Images can be set to the RadioButtonAdv when it is in the Checked, Unchecked or Indeterminate state. The RadioButtonAdv allows us to set the following properties in order to display images.

RadioButtonAdv Properties Description
ImageCheckBox Indicates whether the RadioButton 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 RadioButton when checked and mouse not over.
UncheckedImage Gets or sets the image used to draw the RadioButton when unchecked and mouse not over.
DisabledImage Gets or sets the image used to draw the RadioButton when disabled.
StretchImage Indicates whether the state images of the RadioButton are stretched.

NOTE

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

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

Windows forms RadioButtonAdv image displayed in control when it is in checked

Images displayed during mouse hover

Images can also be set when the mouse is hovered over the RadioButtonAdv control.

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

Windows forms RadioButtonAdv image displayed in control when it is in unchecked