Discussion:
Count button clicks?
(too old to reply)
Samuel van Laere
2009-08-05 20:43:38 UTC
Permalink
Just what code do i need to count the amount of times a button was clicked
and display it on a label?
Something like:
"You clicked this button x times"

Thanks in advance for your help.

Cheers,
Samuel van Laere
Jamie
2009-08-06 18:04:10 UTC
Permalink
Post by Samuel van Laere
Just what code do i need to count the amount of times a button was clicked
and display it on a label?
"You clicked this button x times"
Thanks in advance for your help.
Cheers,
Samuel van Laere
Procedure OnButton1Click(sender:Tobject);
Begin
Button1.Tag := Button1.Tag+1;
Label1.Caption :="You clicked this button "+IntTostr(Button1.Tag)+'
Times ';
End;
Samuel van Laere
2009-08-12 02:58:56 UTC
Permalink
Post by Jamie
Procedure OnButton1Click(sender:Tobject);
Begin
Button1.Tag := Button1.Tag+1;
Label1.Caption :="You clicked this button "+IntTostr(Button1.Tag)+'
Times ';
End;
Thanks Jamie.

Cheers,
Sam

Loading...