none
How do i disable option to resize form RRS feed

  • Question

  • I don't want to use locked propertie, cuz i want users to be able to move form, but i don't want this form to be resized... i figured out how to do this with minimum maimum size by seting them to current size of form, but this is more like workaround.... is there any other way to achieve this ?
    Saturday, October 22, 2005 8:21 PM

Answers

All replies

  • Try converting the form to a fixed dialog in the forms properties.
    Sunday, October 23, 2005 2:06 AM
    Moderator
  • Set the property FormBorderStyle to any type prefixed with "fixed"

    For example Fixed3d
    • Proposed as answer by Christopher84 Sunday, July 7, 2013 1:15 PM
    Monday, July 7, 2008 9:14 PM
  • You can also respond to Resize event and restore original size.
    MCTS, CodeProject MVP 2008
    Monday, July 7, 2008 9:34 PM
  • Set MaximumSize and MinimumSize to the same number.
    Sunday, March 31, 2013 3:31 AM
  • Don't know why you'd bother replying with a suggestion to a thread that is almost 5 years old?!?!

    ~~Bonnie Berent DeWitt [C# MVP]

    geek-goddess-bonnie.blogspot.com

    Sunday, March 31, 2013 4:41 PM
    Moderator
  • You should also consider setting the MaximizeBox property to false. If the user double clicks the title bar or single click the maximize icon, the form will maximize making it look poor.

    Sunday, July 7, 2013 3:27 AM
  • This is an extremely strange comment from an MVP.  The reason people are still responding is that the question is still relevant and still unanswered for some cases.  I have a form sized 1680x1050 that is borderless so suggestions to change to a fixed type cannot be used.  When I open this form in the designer on a machine that has a smaller screen size than 1680x1050, the designer automatically sets the size to something smaller.  After much searching both inside and outside MS forums, I have not found a way to disable resizing by the designer.  Was it not obvious to the developers of this wizard that there is a difference between the development machine and the execution platform?  Why does the wizard corrupt the form at design time rather than understanding that I will execute the finished program on a machine having the needed screen size?

    Even when I use a development machine that has a screen size "large enough" not to provoke the designer into corrupting my form, the form will still get corrupted if the machine's DPI is set differently (e.g. 120 instead of 96).  I regard all of this as a symptom of Microsoft's global compulsion to try to outguess the users of their products.  Decently designed software should not do strange things by default, especially when it is not obvious or impossible to change the default behavior.

    Saturday, April 11, 2015 1:16 PM
  • The reason people are still responding is that the question is still relevant and still unanswered for some cases.  

    When this question was first asked, back in 2005, things were quite a bit different in .NET (and in screen resolutions, and in OS's) than they are now, more than 9 years later!!!

    The question was answered, possibly to the satisfaction of the OP, 9 years ago. But since it doesn't help you with your particular situation, your best bet is to start a new thread, with your new question. And post it in the WinForms forum, not the C# forum. You'll certainly find more help there ... (https://social.msdn.microsoft.com/Forums/windows/en-US/home?forum=winforms)

    Why does the wizard corrupt the form at design time rather than understanding that I will execute the finished program on a machine having the needed screen size?

    I don't see how it can possibly "understand" such a thing.


    ~~Bonnie DeWitt [C# MVP]

    http://geek-goddess-bonnie.blogspot.com

    Sunday, April 19, 2015 5:12 AM
    Moderator