jackie545cs 你好,可以通过 fpSpread1_ButtonClicked 事件去把点击的 CheckBox 所在单元格设置为 选择项,代码如下:
- private void Form1_Load(object sender, EventArgs e)
- {
- FarPoint.Win.Spread.CellType.CheckBoxCellType test = new FarPoint.Win.Spread.CellType.CheckBoxCellType();
- this.fpSpread1.ActiveSheet.Columns[0].CellType = test;
- }
- private void button1_Click(object sender, EventArgs e)
- {
- if (this.fpSpread1.ActiveSheet.SelectionCount>0)
- {
- MessageBox.Show("已选择");
- }
- else
- {
- MessageBox.Show("请选择");
- }
- }
- private void fpSpread1_ButtonClicked(object sender, FarPoint.Win.Spread.EditorNotifyEventArgs e)
- {
- this.fpSpread1.ActiveSheet.AddSelection(e.Row, e.Column, 1, 1);
- }
复制代码 |