How do I stop an MDI parent form from being resized when moved ?

GR15 1 Reputation point
2021-08-16T04:11:43.833+00:00

I have an MDI form (VB.net) which contains about 10 child forms which are permanent and fixed in place and which take up nearly all the whole parent form except for a small margin around the edges and between child forms of about 2px. When I move the parent form, it resizes to a slightly smaller size resulting in the display of scroll bars which cover part of the child forms.
This is extremely annoying and cannot be undone by any programmatic means such as trying to set the form's size : me.Width = ... etc inside an event handler after the screen is moved or resized.

The form is set on the designer in Visual Studio as :
123349-image.png

This program represents many years work, and it is being held hostage by this behaviour, so any ideas would be greatly appreciated.

I have chosen to use child windows instead of using fixed panels, as the program allows those users with multi screens to undock the windows and move and resize them to other screens .

Thanks, Grant.

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,846 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,674 questions
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,599 questions
{count} votes

2 answers

Sort by: Most helpful
  1. GR15 1 Reputation point
    2021-08-17T12:00:17.86+00:00

    Problem fixed using window.owner = parent window instead of MDI.

    No scroll bars or any other behind the scenes interference.

    Everything works great and I have full control of window size and position.

    Keep clear of MDI unless you know what you are doing.
    Now I can get back to actual coding.

    Thanks for your comments.

    0 comments No comments

  2. BgnerNprg207 226 Reputation points
    2024-05-05T01:58:04.38+00:00

    Good day everyone, I hope my answer can help everyone. Base to the question "How do I stop an MDI parent form from being resized when moved ?".

    User's image

    just simply go to MDIParent Properties>> FormBorderStyle and choice FixedSingle.

    It's work for me Properly.

    I hope it's to everyone.

    0 comments No comments