title: Disabling a Windows Form Closing button
body: <p>After hours of Googling on this subject matter, I found the following code snippet which effectively does disable only the close button of a form.</p>
  
  <pre><code>private const int CP_NOCLOSE_BUTTON = 0x200;
  
  protected override CreateParams CreateParams
  {
       get
       {
             CreateParams myCp = base.CreateParams;
             myCp.ClassStyle = myCp.ClassStyle | CP_NOCLOSE_BUTTON;
             return myCp;
       }
  }
  </code></pre>
  
  <p>Now instead of just writing this same snippet in every form, I'm trying to figure out a way to package it into possibly a static method of a class so that I can class it by just one line from anywhere.</p>
  
  <p>But I have faced a problem doing that because this snippet is also an overridden method therefore I don't know how I can put it in to another static method.</p>
  
  <p>I tried the following</p>
  
  <pre><code>using System;
  using System.Windows.Forms;
  
  namespace WindowsFormsApplication1
  {
      public class Common
      {
          private const int CP_NOCLOSE_BUTTON = 0x200;
  
          protected override CreateParams CreateParams
          {
              get
              {
                  CreateParams myCp = base.CreateParams;
                  myCp.ClassStyle = myCp.ClassStyle | CP_NOCLOSE_BUTTON;
                  return myCp;
              }
          }
      }
  }
  </code></pre>
  
  <p>But it throws this error : <em>'WindowsFormsApplication1.Common.CreateParams': no suitable method found to override</em></p>
  
  <p>My question is how can I make this snippet reusable?</p>