博客里面找到个例子 但是 是点击滚动条下面按钮的
- private void Form1_Load(object sender, EventArgs e)
- {
- fpSpread1.ActiveSheet.RowCount = 50;
- fpSpread1.ActiveSheet.ColumnCount = 20;
- //fpSpread1.ActiveSheet.RowCount = fpSpread1.ActiveSheet.NonEmptyRowCount;
- //fpSpread1.ActiveSheet.ColumnCount = fpSpread1.ActiveSheet.NonEmptyColumnCount;
- fpSpread1.HorizontalScrollBar.ButtonClick += new FarPoint.Win.Spread.FpScrollBarButtonClickEventHandler(HorizontalScrollBar_ButtonClick);
- fpSpread1.VerticalScrollBar.ButtonClick += new FarPoint.Win.Spread.FpScrollBarButtonClickEventHandler(VerticalScrollBar_ButtonClick);
-
- }
- void VerticalScrollBar_ButtonClick(object sender, FarPoint.Win.Spread.FpScrollBarButtonClickEventArgs e)
- {
- if (fpSpread1.GetViewportBottomRow(0) == fpSpread1.ActiveSheet.RowCount)
- {
- if (e.Button.ChangeType == FarPoint.Win.Spread.ChangeType.SmallChange)
- {
- fpSpread1.ActiveSheet.RowCount += 1;
- }
- }
- }
- void HorizontalScrollBar_ButtonClick(object sender, FarPoint.Win.Spread.FpScrollBarButtonClickEventArgs e)
- {
- if (fpSpread1.GetViewportRightColumn(0) == fpSpread1.ActiveSheet.ColumnCount)
- {
- if (e.Button.ChangeType == FarPoint.Win.Spread.ChangeType.SmallChange)
- {
- fpSpread1.ActiveSheet.ColumnCount += 1;
- }
- }
- }
复制代码 |