I think you can use the 'OnMouseDown' event handler and put in code that advances the dbnavigator while the mouse is down. This is not tested code but you'll get the idea.
The dbnavigator buttons are: nbFirst,nbPrior,nbNext,nbLast,nbInsert,nbDelete
nbEdit,nbPost,nbCancel,nbRefresh
Create a boolean variable 'mouseup' and set it to false in the OnMouseDown event
(there are OnMouseDown and OnMouseUp event handlers in the dbnavigator)
You probably need some sort of timer to time how many times per second
you click the dbnavigator button. I found a neat little delay snippet on the web.
So, putting it all together:
1. Make the mouseup boolean variable global in scope by putting it in the implementation section of your code.
...
implementation
var mouseup: boolean;
...
// delay in milliseconds, uses the system time, also uses
// Application.ProcessMessages, which allows access to other events
// during the delay, the Win32 API function Sleep() does not
//
procedure Tform.Delay(msecs: integer);
var
FirstTickCount: longint;
begin
FirstTickCount := GetTickCount;
repeat
Application.ProcessMessages;
until ((GetTickCount-FirstTickCount) >= Longint(msecs));
end;
procedure Tform.dbnavigator_itemMouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
mouseup := false; // we got here by a mouse down event
while not mouseup do begin // keep at it as long as mouse_btn is down
// wait one second
delay(1000); // 1000 mS = second
dbnavigator_file.BtnClick(nbNext);
// do anything else you need to do
end;
end;
procedure Tform.dbnavigator_itemMouseUp(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
mouseup := true;
end;
This will get you started at least I hope.
Mike