I posted a rather confused request earlier and I have greatly simplified my problem and I have attached a winzip file with a project that demonstrate the problem.
I have created a MDI parent form. I have also created two different form classes to be MDI child forms. One of the form classes has a Label object inside. The other form has a UserControl inside.
For my example project, I have created two menu items on the File Menu to aid in reproducing the problem.
One menu item lets you create an instance of the Form with a label and the other menu item lets you create instances of the form with the UserControl.
The first step is to create two of the child forms. Test one is to create two of the forms containing the Label, and test two is to create two of the forms containing the UserControl.
For both tests, after the MDI child forms have been created, shrink them down vertically so scroll bars appear. Then drag the scrollbars down to the bottom of the form.
For both test, you will select one child form, and then select another child form, in effect, changing focus between the two forms.
For test one with the Label case, nothing happens and it works as I would expect it to work.
For test two, when you click on one child, then another, the contained UserControl jumps and the scroll bar moves to reposition the contents of the form.
I dont want the contents of the child form to be repositioned when you change focus to/from a child. I want test two to act the same as test one.
Having this behavior really breaks my app; I cannot have windows automatically moving contents after a user has carefully positioned the windows and the scroll bars where they want them.
How can I keep the contents of a form with a UserControl in the same place even if the user moves around between different MDI child windows?
Any help would be greatly appreciated!
Bryan
I have created a MDI parent form. I have also created two different form classes to be MDI child forms. One of the form classes has a Label object inside. The other form has a UserControl inside.
For my example project, I have created two menu items on the File Menu to aid in reproducing the problem.
One menu item lets you create an instance of the Form with a label and the other menu item lets you create instances of the form with the UserControl.
The first step is to create two of the child forms. Test one is to create two of the forms containing the Label, and test two is to create two of the forms containing the UserControl.
For both tests, after the MDI child forms have been created, shrink them down vertically so scroll bars appear. Then drag the scrollbars down to the bottom of the form.
For both test, you will select one child form, and then select another child form, in effect, changing focus between the two forms.
For test one with the Label case, nothing happens and it works as I would expect it to work.
For test two, when you click on one child, then another, the contained UserControl jumps and the scroll bar moves to reposition the contents of the form.
I dont want the contents of the child form to be repositioned when you change focus to/from a child. I want test two to act the same as test one.
Having this behavior really breaks my app; I cannot have windows automatically moving contents after a user has carefully positioned the windows and the scroll bars where they want them.
How can I keep the contents of a form with a UserControl in the same place even if the user moves around between different MDI child windows?
Any help would be greatly appreciated!
Bryan