- private void Form1_Load(object sender, EventArgs e)
- {
-
- this.fpSpread1.AllowDragFill = true;
- this.fpSpread1.DragFillBlockCompleted += fpSpread1_DragFillBlockCompleted;
-
- }
- void fpSpread1_DragFillBlockCompleted(object sender, FarPoint.Win.Spread.DragFillBlockCompletedEventArgs e)
- {
- if (e.Direction == FillDirection.Down
- || e.Direction == FillDirection.Up)
- {
- for (int i = e.RowBegin + 1; i < e.RowBegin + 1 + e.NumberToCopy; i++)
- {
- this.fpSpread1.ActiveSheet.Cells[i, e.ColumnBegin].Value = Convert.ToInt64(this.fpSpread1.ActiveSheet.Cells[e.RowBegin, e.ColumnBegin].Value) + i;
- }
- }
- }
复制代码 |