Replied 8 September 2017, 1:13 pm EST
Thanks for the speedy reply. That does indeed allow me to use my custom mousewheel functions without the flickering but freezing the rows creates another problem. When I freeze the rows, the viewport moves to the top of the spreadsheet so the first row is visible. Calling SetViewportTopRow to send it back to where it was doesn't seem to do anything after the rows are frozen (and if it did, might cause the flickering again). In most cases, I can reset the top row after I unfreeze the rows but occasionally the viewport goes all the way to the bottom. I'm probably going about it the wrong way so I've included the code I'm using to freeze and unfreeze the rows below:
private int _lastTopRow = 0; // private class variable.
/* Disable spreadsheet scrolling */
_lastTopRow = FpSpread1.GetViewportTopRow(0);
int currentBottomRow = FpSpread1.GetViewportBottomRow(0);
FpSpread1.ActiveSheet.FrozenRowCount = currentBottomRow; // Freeze everything up to the bottom visible row.
// If I call GetViewportTopRow(0) again here, it returns the same value as currentBottomRow for some reason.
FpSpread1.SetViewportTopRow(0, _lastTopRow); // Appears to have no effect.
/* Re-enable spreadsheet scrolling */
FpSpread1.ActiveSheet.FrozenRowCount = 0;
FpSpread1.SetViewportTopRow(0, _lastTopRow); // Works most of the time but occasionally the viewport goes to the very bottom.