本帖最后由 Richard.Ma 于 2021-1-8 17:30 编辑
比如给第二行第二列的单元格设置为按钮
1.将你需要变成按钮的单元格通过Spread设计器或者代码设置单元格类型为Button代码的话是
- fpSpread1.ActiveSheet.Cells[1, 1].CellType = new ButtonCellType();
复制代码
2.给cellclick事件添加方法
- private void fpSpread1_CellClick(object sender, CellClickEventArgs e)
- {
- if (e.Column == 1 && e.Row == 1)
- {
- MessageBox.Show("触发事件");
- }
- }
复制代码
|