Simple question. If I set a radiobutton in a winform project read only it\'s appearance (font color) changes to light grey. Same when I set it\'s enabled property to false,
As an option you can add a ReadOnly
property and override OnClick
and call base.OnClick(e)
only if !ReadOnly
:
using System;
using System.Windows.Forms;
public class MyRadioButton : RadioButton
{
public bool ReadOnly { get; set; }
protected override void OnClick(EventArgs e)
{
if (!ReadOnly)
base.OnClick(e);
}
}