three timer component problem inside my checkbox event procedure

Reply

Join Date: Nov 2007
Posts: 29
Reputation: ferhatkuskaya is an unknown quantity at this point 
Solved Threads: 0
ferhatkuskaya ferhatkuskaya is offline Offline
Light Poster

three timer component problem inside my checkbox event procedure

 
0
  #1
Nov 29th, 2007
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;
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 1,951
Reputation: Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of Duoas has much to be proud of 
Solved Threads: 214
Featured Poster
Duoas's Avatar
Duoas Duoas is offline Offline
Posting Virtuoso

Re: three timer component problem inside my checkbox event procedure

 
0
  #2
Nov 29th, 2007
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Pascal and Delphi Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC