title: I want to keep a function running continuously in my Winform C# project, until the form window is closed
body: <p>I want to keep a function running continuously in my Winform C# project, until the form window is closed. I don't want to put it in a very long timer and call it again and again. What shall I do?</p>
  
  <p>I need something like this to keep validating if the form is open or closed continuously:</p>
  
  <pre><code>while(this.close() == false)
  {
   my_func();
  }
  </code></pre>
  
  <p>the above code is certainly wrong but I wrote that to give you an idea as to what I want.</p>