void HorizontalScrollBar_Scroll(object sender, ScrollEventArgs e) { if (ActiveSheet != null && ActiveSheet.ContainingViews.Length > 0) { SpreadView View = ActiveSheet.ContainingViews[0]; LeftColumn = View.GetViewportLeftColumn(ActiveSheetIndex, 0); RightColumn = View.GetViewportRightColumn(ActiveSheetIndex, 0); Invalidate(); } }
protected override bool IsInputKey(Keys keyData) { if (ActiveSheet != null && ActiveSheet.ContainingViews.Length > 0) { SpreadView View = ActiveSheet.ContainingViews[0]; TopRow = View.GetViewportTopRow(ActiveSheetIndex, 0); BottomRow = View.GetViewportBottomRow(ActiveSheetIndex, 0); LeftColumn = View.GetViewportLeftColumn(ActiveSheetIndex, 0); RightColumn = View.GetViewportRightColumn(ActiveSheetIndex, 0); Invalidate(); } return(base.IsInputKey(keyData)); }
protected override void OnActiveSheetChanged(EventArgs e) { base.OnActiveSheetChanged(e); if (ActiveSheet != null && ActiveSheet.ContainingViews.Length > 0) { SpreadView View = ActiveSheet.ContainingViews[0]; TopRow = View.GetViewportTopRow(ActiveSheetIndex, 0); BottomRow = View.GetViewportBottomRow(ActiveSheetIndex, 0); LeftColumn = View.GetViewportLeftColumn(ActiveSheetIndex, 0); RightColumn = View.GetViewportRightColumn(ActiveSheetIndex, 0); } UpdateColumnsWidth(); UpdateRowsHeight(); Invalidate(); }
void Sheet_PropertyChanged(object sender, SheetViewPropertyChangeEventArgs e) { if (e.PropertyName == "PrintInfo") { Invalidate(); } else if (e.PropertyName == "RowCount" || e.PropertyName == "ColumnCount") { if (ActiveSheet.ContainingViews.Length > 0) { SpreadView View = ActiveSheet.ContainingViews[0]; TopRow = View.GetViewportTopRow(ActiveSheetIndex, 0); BottomRow = View.GetViewportBottomRow(ActiveSheetIndex, 0); LeftColumn = View.GetViewportLeftColumn(ActiveSheetIndex, 0); RightColumn = View.GetViewportRightColumn(ActiveSheetIndex, 0); } UpdateColumnsWidth(); UpdateRowsHeight(); Invalidate(); } }