title: How to disable resize for borderless form c#
body: <p>I have a Form that is fullscreen and borderless, but I would like to prevent resizing the form by any means (dragging form up to the top, and stretching from the corner of the form. How can I achieve this?</p>
  <pre><code>private void FormCashFlow_Load(object sender, EventArgs e)
          {
             
              CashFlow cash = new CashFlow();
              this.ControlBox = False;
              this.WindowState = FormWindowState.Maximized;
              this.SizeGripStyle = SizeGripStyle.Hide;
          }
  
  </code></pre>
  <p>Edit:</p>
  <p>The Main Form contains no control box, but has a panel at the top for dragging and resizing the form (with custom logic). There is a menu on the side that has buttons for loading different forms into the main form. When the user clicks the button, the child form is loaded into a panel on the main form. When the child form is loaded, the child form is maximized. I would like to keep that child form maximized with the inability to resize.</p>
  <p>I apologize if this is hard to follow.</p>
  <pre><code>public partial class MainForm : Form
      {
          //Fields
          private IconButton currentBtn;
          private Panel leftBoderButton;
          private Form currentChildForm;
  
  
          public MainForm()
          {
              InitializeComponent();
              this.MinimumSize = new Size(1650, 800);
              leftBoderButton = new Panel();
              panelMenu.Controls.Add(leftBoderButton);
  
              this.Text = String.Empty;
              this.ControlBox = false;
              this.DoubleBuffered = true ;
              this.MaximizedBounds = Screen.FromHandle(Handle).WorkingArea; //Fix window full screen resize
          }
  
  
          [DllImport(&quot;user32.DLL&quot;, EntryPoint = &quot;ReleaseCapture&quot;)]
          private extern static void ReleaseCapture();
  
          [DllImport(&quot;user32.DLL&quot;, EntryPoint = &quot;SendMessage&quot;)]
          private extern static void SendMessage(System.IntPtr hWnd, int wMsg, int wParam, int lParam);
         
          
          private void panelMain_MouseMove(object sender, MouseEventArgs e)
          {
              if (e.Button == MouseButtons.Left)
              {
                  ReleaseCapture();
                  SendMessage(Handle, 0xA1, 0x2, 0);
              }
          }
  
   private void OpenChildForm(Form childForm)
          {
              if (currentChildForm != null)
              {
                  currentChildForm.Close();
              }
              currentChildForm = childForm;
              childForm.TopLevel = false;
              childForm.FormBorderStyle = FormBorderStyle.None;
              childForm.Dock = DockStyle.Fill ;
              panelDesktop.Controls.Add(childForm);
              panelDesktop.Tag = childForm;
              childForm.BringToFront();
              childForm.Show();
              childForm.WindowState = FormWindowState.Maximized;
          }
  
  private void iconButton4_Click(object sender, EventArgs e)
          {
              
              OpenChildForm(new FormCashFlow);
              
          }
  
  </code></pre>