Delphi: prevent H and V scrolling of a grid

Cancelado Publicado Jun 5, 2009 Pagado a la entrega
Cancelado Pagado a la entrega

please see the attach video.

If I play with the mouse wheel or with the arrows keys or click the 2nd grid row, the grid vertically scrolls.

The same would happen in the horizontal plane if the grid had more columns.

I want to prevent this.

I always want

grid.top=0 and

grid.left=0

I tried all sort of tricks inside OnTopLeftChanged event but had no success.

The grid I am using is of type TProfGrid (free trial at [url removed, login to view]), but I guess that its behaviour here is the same as a standard TStringGrid.

The trick you suggest must work with Delphi 5.

As far as I could understand this is done properly handling messages WM_HSCROLL and WM_VSCROLL.

I was able to disable scrolling due to arrows key and to mouse wheel, but the scrolling due to a mouse click beats me.

Ingeniería MySQL PHP Gestión de proyectos Arquitectura de software Verificación de software

Nº del proyecto: #3924635

Sobre el proyecto

Proyecto remoto Activo Jun 8, 2009