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.

Developer technologies | Windows Forms
Developer technologies | VB
Developer technologies | Visual Studio | Other
{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. Anonymous
    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

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.