Prevent users from resizing the window/form size

前端 未结 11 1007
粉色の甜心
粉色の甜心 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条回答
  • 2020-12-02 00:02

    Change the BorderStyle to be one of the "Fixed" styles and remove the maximize button.

    0 讨论(0)
  • 2020-12-02 00:02

    You can change the border style to :

    BorderStyle - fixedToolWindow

    But you will loose the maximize and minimize buttons, custom buttons will be needed if you require those functionalities.

    0 讨论(0)
  • 2020-12-02 00:14

    Change FormBorderStyle to FixedDialog, FixedSingle, or Fixed3D. Also, if you do not want them to maximize the form set Maximize to False.

    0 讨论(0)
  • 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

    0 讨论(0)
  • 2020-12-02 00:17

    From the Form Properties Window set:
    1. FormBorderStyle -> FixedSingle.
    2. MaximizeBox -> False.

    0 讨论(0)
提交回复
热议问题