how to prevent none state form from being maximized in c#

后端 未结 2 590
清酒与你
清酒与你 2021-01-24 15:56

i have created a form and set its FormBorderStyle property to none. when i press Windows + UP form will be Maximized. how

2条回答
  •  死守一世寂寞
    2021-01-24 16:05

    // Define the border style of the form to a dialog box.
    form1.FormBorderStyle = FormBorderStyle.FixedDialog;
    
    // Set the MaximizeBox to false to remove the maximize box.
    form1.MaximizeBox = false;
    
    // Set the MinimizeBox to false to remove the minimize box.
    form1.MinimizeBox = false;
    

    Credit to How do I disable form resizing for users?

提交回复
热议问题