944,139 Members | Top Members by Rank

Ad:
Nov 29th, 2007
0

three timer component problem inside my checkbox event procedure

Expand Post »
I used 3 timer component and I m using one checkbox. And I have three procedures for timer1, timer2 and timer3 and I writed below these in my unit code explorer. Note that band1,band2 and band3 are images that will be animated ordinarily.
procedure TForm1.Timer1Timer(Sender: TObject);
begin
timer1.Enabled:=true;
timer1.Interval:=2000;
band1.Visible:=true;
end;

procedure TForm1.Timer2Timer(Sender: TObject);
begin

if band1.Visible=true then
begin
timer2.Enabled:=true; //set timer2
timer2.Interval:=4000;//work timer2 40 million miliseconds
band2.Visible:=true; //fire the command
end;
end;

procedure TForm1.Timer3Timer(Sender: TObject);
begin
if band2.Visible=true then
begin
timer3.Enabled:=true;
timer3.Interval:=6000;
band3.Visible:=true;
end;
But I want to use these three events in my checkbox6 component's click event procedure. can you help me about that object. how will I write the code inside my click event procedure for using my timer components according to checking position of my checkbox whose caption is "animate" .
procedure TAnaform.CheckBox6Click(Sender: TObject);
begin
if checkbox6.Checked then
begin
?????????????????????*here how will I write code using sender reserved word
???????????????????????
???????????????????????????
end;
end;
Reputation Points: 10
Solved Threads: 0
Light Poster
ferhatkuskaya is offline Offline
29 posts
since Nov 2007
Nov 29th, 2007
0

Re: three timer component problem inside my checkbox event procedure

You have still failed to stick your code in [code] blocks, so that it is not a nightmare to read.

May I ask what exactly it is you are doing that requires so many components and timers all on one form? Your program is going to work like an elephant in a chicken coup.

To use a timer, just read your TTimer documentation. It gives very nice examples of how to use it.
Featured Poster
Reputation Points: 1140
Solved Threads: 229
Postaholic
Duoas is offline Offline
2,039 posts
since Oct 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Pascal and Delphi Forum Timeline: using only one procedure for more than one components
Next Thread in Pascal and Delphi Forum Timeline: RES file creaton under Vista





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC