<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Yes, it works but Button1Exit is not the best because it control the
focus and when i click on button the focus remain on the button. I will
try to change focus or maybe TButton.OnMouseDown and the timer event...<br>
Thank you for the idea, <span id="result_box" class="short_text"><span
style="background-color: rgb(235, 239, 249);"
title="hai svegliato il mio cervello">you woke up my brain</span></span>
;)<br>
<br>
Andy.<br>
<br>
<br>
Howard Page-Clark ha scritto:
<blockquote cite="mid:4B9BCF38.8070409@talktalk.net" type="cite">On
13/3/10 3:42, andtag wrote:
<br>
<blockquote type="cite">Hello,
<br>
I have a DB with 400 records and clicking the next button i can see the
<br>
next record. If i want to reach record 200 i must do 200 clicks.
<br>
I want to have a continue action pressing the dbnavigator button, for
<br>
example, when i click Next button, i want the records go forward until
i
<br>
leave the button. Is possible to do?
<br>
</blockquote>
Is something like this what you are looking for?
<br>
<br>
Add a boolean FButtonHeldDown as a private variable of TForm1, and a
normal button, Button1. Add this code to OnClick and OnExit events of
Button1.
<br>
<br>
procedure TForm1.Button1Click(Sender: TObject);
<br>
var sequence: integer;
<br>
begin
<br>
FButtonHeldDown := true;
<br>
sequence := 0;
<br>
while FButtonHeldDown and not dbf1.EOF do
<br>
begin
<br>
dbf1.Next;
<br>
inc(sequence);
<br>
label1.Caption := Format('cursor moved forward %d
times',[sequence]);
<br>
Application.ProcessMessages;
<br>
Sleep(100);
<br>
end;
<br>
end;
<br>
<br>
procedure TForm1.Button1Exit(Sender: TObject);
<br>
begin
<br>
FButtonHeldDown := false;
<br>
end;
<br>
<br>
<br>
<blockquote type="cite">exists a function for know if a button is
pressed down, not only
<br>
a click?
<br>
</blockquote>
TButton.OnMouseDown?
<br>
<br>
Howard
<br>
<br>
--
<br>
_______________________________________________
<br>
Lazarus mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:Lazarus@lists.lazarus.freepascal.org">Lazarus@lists.lazarus.freepascal.org</a>
<br>
<a class="moz-txt-link-freetext" href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a>
<br>
<br>
</blockquote>
<br>
</body>
</html>