回复 1楼rkk的帖子
参考代码如下:
- Random r = new Random();
- int i, j;
- DialogResult dlg;
- for (i = 0; i <= 3; i++)
- {
- for (j = 0; j <= 3; j++)
- {
- fpSpread1.ActiveSheet.SetValue(i, j, r.Next() -100000);
- }
- }
- fpSpread1.ActiveSheet.SetFormula(5, 0, "Sum(A1, B2)");
- fpSpread1.ActiveSheet.SetNote(5, 3, fpSpread1.ActiveSheet.Cells[2, 2].Text);
- dlg = MessageBox.Show("Do you want to clear the range?", "ClearRange", MessageBoxButtons.YesNo);
- if (dlg == DialogResult.Yes)
- {
- fpSpread1.ActiveSheet.ClearRange(0, 0, 6, 6);
- }
复制代码 |