Disable resizing of a Windows Forms form

后端 未结 5 673
耶瑟儿~
耶瑟儿~ 2020-12-07 10:27

How do I turn off the user\'s ability to resize a Windows Forms form?

I\'m having it resize itself on a click.

5条回答
  •  半阙折子戏
    2020-12-07 11:04

    Take a look at the FormBorderStyle property

    form1.FormBorderStyle = FormBorderStyle.FixedSingle;
    

    You may also want to remove the minimize and maximize buttons:

    form1.MaximizeBox = false;
    form1.MinimizeBox = false;
    

提交回复
热议问题