title: Re-Open a Form after done Counting time over and over
body: <p>I have a problem with some codes here , its something like you have a form that maximize and control the screen, when you login you have time to use the computer, right after the time stop or end the time counting the form will maximize again .</p>
  
  <p>The problem is I don't know how to catch if the timer is stop or done counting </p>
  
  <p>Thank you for you time !</p>
  
  <pre><code>private void Monitoring_Load(object sender, EventArgs e)
  {
      try
      {            
          fs.Maximize(this, this, e);
  
      }
      catch (Exception ex)
      {
          MessageBox.Show(ex.Message.ToString(), "Errors");
      }
  }
  
  private void btn_login_Click(object sender, EventArgs e)
  {
  
              fs.Restore(this);
              T.Show();
              if (T.IsDisposed == true)
              {
                  fs.Maximize(this, this, e);
              }
              else
              { fs.Restore(this); }
  
          catch (Exception ex)
          {
              MessageBox.Show(ex.Message.ToString(), "Errors");
          }
  }
  
  
  /////////////////////////////////////
  
  
  
  public void Maximize(Form targetForm, object sender, EventArgs e)
  {
  
      //////////////////////////////////
      ct.hidetaskbar();
      cu.DisableTaskmanager();
      cu.DisableUserSwitching();
      cu.DisableWorkstationLock();
      ck.KeyboardHook(this, e);
      ////////////////////////////////////
      targetForm.WindowState = FormWindowState.Maximized;
      targetForm.FormBorderStyle = FormBorderStyle.None;
      targetForm.TopMost = true;
      targetForm.ShowInTaskbar = false;
      targetForm.ControlBox = false;
      FullScreen.SetWinFullScreen(targetForm.Handle);
  }
  ////////////////////////////////////////
  
   public void Restore(Form targetForm)
  {
      ////////////////////////////////////
      cu.EnableTaskManager();
      cu.EnableUserSwitching();
      cu.EnableWorkstationLock();
      ct.showtaskbar();
      ck.ReleaseKeyboardHook();
      ///////////////////////////////////
      targetForm.ControlBox = false;
      targetForm.FormBorderStyle = FormBorderStyle.FixedSingle;
      targetForm.WindowState = FormWindowState.Minimized;
      targetForm.ShowInTaskbar = true;
      targetForm.Visible = true;
      targetForm.Hide();
  }
  
  ///////////////////////////////////
  
  
  
  public partial class Timer : Form
  {
      int h;
      int m = 15;
      int s;
  
      public Timer()
      {
          InitializeComponent();
          Rectangle workingArea = Screen.GetWorkingArea(this);
          this.Location = new Point(workingArea.Right - Size.Width,
                                    workingArea.Bottom - Size.Height);
          timer1.Enabled = true;
          timer1.Start();
      }
  
      private void timer1_Tick(object sender, EventArgs e)
      {
          if (h &gt; 0)
          {
  
              if (m &gt; 0)
              {
                  if (s &gt; 0)
                  {
                      s--;
                  }
                  else
                  {
                      s = 59;
                      m--;
                  }
              }
              else
              {
                  m = 59;
                  h--;
              }
  
  
          }
          else
              if (h == 0)
          {
              if (m &gt; 0)
              {
                  if (s &gt; 0)
                  {
                      s--;
                  }
                  else
                  {
                      s = 59;
                      m--;
                  }
              }
              else
              {
                  s--;
              }
              this.lb_h.Text = h.ToString();
              this.lb_m.Text = m.ToString();
              this.lb_s.Text = s.ToString();
          }
          if (h == 0 &amp;&amp; m == 0 &amp;&amp; s == 0)
          {
              timer1.Stop();
              this.Close();
          }
      }
  
      private void btn_end_Click(object sender, EventArgs e)
      {
          timer1.Stop();
          this.Close();
      }
  }
  </code></pre>