回复 7楼dof的帖子
现在的解决方法是在DragFillBlock事件中,自己实现拖动填充功能,比如向右拖动可以使用下面的代码来实现:
- private void fpSpread1_DragFillBlock(object sender, FarPoint.Win.Spread.DragFillBlockEventArgs e)
- {
- if (e.Direction == FarPoint.Win.Spread.FillDirection.Left || e.Direction == FarPoint.Win.Spread.FillDirection.Right)
- {
- e.Cancel = true;
- switch (e.Direction)
- {
- case FarPoint.Win.Spread.FillDirection.Down:
- break;
- case FarPoint.Win.Spread.FillDirection.Left:
- break;
- case FarPoint.Win.Spread.FillDirection.Right:
- int i = 0;
- int l_c_count = 0;
- int c_count = e.ColumnEnd - e.ColumnBegin + 1;
- int r_count = e.RowEnd - e.RowBegin + 1;
- int c_count_s = (e.NumberToCopy % c_count == 0 ? e.NumberToCopy / c_count : e.NumberToCopy / c_count + 1);
- CellRange fRange = new CellRange(e.RowBegin, e.ColumnBegin, r_count, c_count);
- CellRange tRange;
- for (; i < c_count_s - 1; ++i)
- {
- tRange = new CellRange(e.RowBegin, e.ColumnEnd + i * c_count + 1, r_count, c_count);
- CopyCellRangeText(fRange, tRange);
- }
- l_c_count = (e.NumberToCopy % c_count == 0 ? c_count : e.NumberToCopy % c_count);
-
- tRange = new CellRange(e.RowBegin, e.ColumnEnd + i * c_count + 1, r_count, l_c_count);
- CopyCellRangeText(fRange, tRange);
- break;
- case FarPoint.Win.Spread.FillDirection.Up:
- break;
- default:
- break;
- }
- CellRange cr = fpSpread1.ActiveSheet.GetSelection(0);
- }
- }
复制代码 |