Posted 14 August 2020, 3:28 am EST
Hi David,
Yes, I observe it too and it is a design behavior.
The PaintCell of CheckBoxCellType is responsible for drawing the checkbox. When the sheet is protected or the control is disabled, SpreadView passes true for its isLocked parameter and when isLocked is true, PaintCell will draw the checkbox disabled when drawing the cell.
So, you can create a custom CheckBoxCellType that overrides the default behavior and draws it normally instead.
For this, you will need to override the PaintCell and define the value for isLocked as false in the call to the base class. The cells will draw as they would if they were not locked, but will still be locked from editing.
public class CustomCheckboxCellType: FarPoint.Win.Spread.CellType.CheckBoxCellType { public override void PaintCell(Graphics g, Rectangle r, FarPoint.Win.Spread.Appearance appearance, object value, bool isSelected, bool isLocked, float zoomFactor) { isLocked = false; base.PaintCell(g, r, appearance, value, isSelected, isLocked, zoomFactor); } }
Also, you can set the disabled picture for the CheckBoxCellType object, as follows:```
checkBoxCellType.Picture[CheckBoxPictureIndex.TrueDisabled] = (Image)Properties.Resources._checked;
checkBoxCellType.Picture[CheckBoxPictureIndex.FalseDisabled] = (Image)Properties.Resources._unchecked;
The dimension of the checkbox is determined by the Windows. To increase the height, you should set a custom image, using any of the methods above.
Regards,