Prevent users from resizing the window/form size

前端 未结 11 1042
粉色の甜心
粉色の甜心 2020-12-01 23:28

User can change form size. I do not find a property of form that do not allow user to change form size.

11条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-02 00:16

    Just add this 2 lines of C# code for your form (inside InitializeComponent() function):

    this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
    this.ImeMode = System.Windows.Forms.ImeMode.NoControl;
    

    Tested with Visual Studio 2017 with .NET 4.6.1

提交回复
热议问题