c# - Winforms - Disable that when user drags form by the border to move it, it resizes the form -


i have winforms project form in maximized (this.windowstate = system.windows.forms.formwindowstate.maximized). when user drags form border move form around, resizes size have set (which not maximum screen size since not know values set minimumsize property maximized on every screen).

i not want behaviour. want form stay maximized. have set formborderstyle fixeddialog, user can not resize form dragging borders. have tried re-set maximized window state in kinds of events, not seem work.

does know how fix this?

this might trick you

this.minimumsize = this.maximumsize; this.sizegripstyle = sizegripstyle.hide; 

and can try write onresize event of form

this.windowstate = system.windows.forms.formwindowstate.maximized 

change formborderstyle 1 of fixed values: fixedsingle, fixed3d, fixeddialog or fixedtoolbar

// define border style of form dialog box. this.formborderstyle = formborderstyle.fixeddialog;  // set maximizebox false remove maximize box. this.maximizebox = false;  // set minimizebox false remove minimize box. this.minimizebox = false; 

Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -