Place Form windows at certain position in MDI Application
-
I want to place a MDI form at a certain position in relation to the MDI background application window. Ie. When I display a certain form I would like to display the form on the right of the applications MDI window and locatthis child form in the top right corner. How could I achieve this in c#.
-
I want to place a MDI form at a certain position in relation to the MDI background application window. Ie. When I display a certain form I would like to display the form on the right of the applications MDI window and locatthis child form in the top right corner. How could I achieve this in c#.
In the Activate or Shown Event of the child form you could probably include code like the following:
this.Location = new Point(this.ParentForm.Width - (this.Width + 10), 0);
Of course, if you put the code in the Activate event you will want to ensure the code only executes the first time the form activates. That should get your MDI child in the ballpark of the right corner of the parent form. You might have to play around with the value you add to this.Width a little bit. Good luck.