回复 1楼wangmj的帖子
wangmj 新年好
你需要的功能请参考以下代码:
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- fpSpread1.Sheets[0].Columns[0].CellType = new FarPoint.Win.Spread.CellType.CheckBoxCellType();
- fpSpread1.EditModeOn += new EventHandler(fpSpread1_EditModeOn);
- fpSpread1.SelectionChanged += new FarPoint.Win.Spread.SelectionChangedEventHandler(fpSpread1_SelectionChanged);
- }
- void fpSpread1_SelectionChanged(object sender, FarPoint.Win.Spread.SelectionChangedEventArgs e)
- {
- if (fpSpread1.ActiveSheet.ActiveColumnIndex == 0)
- {
- fpSpread1.EditModePermanent = true;
- }
- else
- {
- fpSpread1.EditModePermanent = false;
- }
- }
- void fpSpread1_EditModeOn(object sender, EventArgs e)
- {
- FarPoint.Win.FpCheckBox control = fpSpread1.EditingControl as FarPoint.Win.FpCheckBox;
- if (control != null)
- {
- control.KeyDown -= new KeyEventHandler(control_KeyDown);
- control.KeyDown += new KeyEventHandler(control_KeyDown);
- }
- }
- void control_KeyDown(object sender, KeyEventArgs e)
- {
-
- }
- }
复制代码 |