Dadyar Salar

Dadyar Salar

  • NA
  • 64
  • 9.5k

C# timer problem

Jan 30 2020 11:39 AM
When i Enable The timer while running program? my program will not doing anything else and stop of doing any click i do like exit the program or anything else i am just having this problem in this timer i have another 2 timer when i enable them there is no problem and it is my code on that timer when enable it:
  1.               private void timer1_Tick(object sender, EventArgs e)  
  2.         {  
  3.              
  4.   
  5.                 bool check = login.remain_AttemptsTime();  
  6.   
  7.                 if (check)  
  8.                 {  
  9.                     login.reset_afterRestricted();  
  10.   
  11.                     timer1.Enabled = false;  
  12.                     textBox1.Enabled = true;  
  13.                     textBox2.Enabled = true;  
  14.                     button1.Enabled = true;  
  15.                 }  
  16.                 else  
  17.                 {  
  18.   
  19.                     timer1.Enabled = true;  
  20.                     textBox1.Enabled = false;  
  21.                     textBox2.Enabled = false;  
  22.                     button1.Enabled = false;  
  23.   
  24.                 }  
  25.     
  26.         } 
 

Answers (4)