2
Answers

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

honar abubakr

honar abubakr

10y
1.1k
1
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)