honar abubakr

honar abubakr

  • NA
  • 73
  • 110.7k

Disable a c# form if not used for a certain duration? See m

Apr 3 2014 9:59 AM
i have a c# project that have 4 forms one of these form is main form i want to make the main form is disabled (all controls on the main form) if i don't use it(don't work on it) in certain duration of time for example in 10 minutes, i use the timer and it disable the main form controls but it do this also if i work on it
this is my code:
private void main_Load(object sender, EventArgs e) {     timer1.Interval = 10000; // 1 minute in milliseconds     timer1.Enabled = true; // start timer  }
private void timer1_Tick(object sender, EventArgs e) { timer1.Enabled = false; // stop timer lib_bt.Enabled = false; }


Answers (2)