Subject Re: [IBO] IB_Grid and DoubleBuffered
Author Geoff Worboys
> It's not really a problem. I noticed, that, when I scroll
> with the mousewheel, the grid is flickering
> and when DoubleBuffered is true, the flickering is gone.
> Perhaps there is another way to avoid these flickering ?

Dont scroll <g>

Flickering has always been a bit of a problem with the grid, although
the severity of the problem varies a lot depending on many things -
speed of computer, complexity of application and query etc.

I had never thought to try the DoubleBuffer property. I've got a few
readonly grids that may benefit from this.

Does the doublebuffer problem go away when AlwaysShowEditor is false
in your situation?

It sounds like the situation is worse when you use the mousewheel. I
wonder if the situation can be improved by altering the mousewheel
handling of the grid.

At the moment it appears that IB_Grid is issuing a simple Scroll( 1 )
or Scroll( -1 ) call for each WheelDown/WheelUp message. My first
comment is that this should not be any different to what you see when
you scroll using the up/down arrow keys.

But anyway, it would be possible to change the handling so that it
only responded to the MouseWheel event - scrolling the full number of
iterations with each event. The visual feedback would not be as
good - since the grid would not scroll row by row, but jump by the
number of rows specified in the event.

I seem to recall that you have derived your own grid already? If so,
you could experiment with the above by simply adding an override to
the DoMouseWheel procedure (see TWinControl.DoMouseWheel for
parameters) and calling

Scroll( -WheelDelta );

- and DONT call inherited, to avoid having the individual calls to
WheelDown/WheelUp issued.


Geoff Worboys
Telesis Computing