Programming => General => Topic started by: DeBritto on May 15, 2019, 11:27:03 pm
Title: StringGrid: Drag and Drop with Scroll Feature
Post by: DeBritto on May 15, 2019, 11:27:03 pm
Hi Folks,
I have a StringGrid with lots of cells. I can successfully drag and drop them. But there's a problem when I need to drop some cell that is localized beyond the screen area, i.e. when I need to scroll the screen to find the location to drop the cell. Is it possible to create a routine that scrolls the StringGrid to enable the user to find the position he wants?
Warm regards, Christian
Title: Re: StringGrid: Drag and Drop with Scroll Feature
Post by: Handoko on May 16, 2019, 05:14:20 am
I haven't tried, but I think it will be easier to use TScrollBox or TListView or maybe write a new component.
But if you use TStringGrid, you can check the mouse position using TStringGrid.OnMouseMove event and if the mouse position reaches the edge of the stringgrid then you call TStringGrid.ScrollBy to scroll it by code.
Title: Re: StringGrid: Drag and Drop with Scroll Feature
Post by: DeBritto on May 16, 2019, 06:33:48 am