This project has moved and is read-only. For the latest updates, please go here.

Dynamic window location of ChildWindow

Nov 18, 2011 at 1:52 PM
Edited Nov 18, 2011 at 1:52 PM


thanks for the great control.

I have a question concerning the positioning of the childwindow: I set the WindowStartupLocation to Center. So when the window opens it is nicely in the middle of the MainWindow. But when I change the size of the MainWindow, the Position of the ChildWindow does not dynamically change to the "new" center of the resized window!

Any idea how I can solve this problem?




Nov 18, 2011 at 2:31 PM

Are you changing the size before you show it?

Nov 21, 2011 at 6:22 AM

The size of the childwindow is set with height and width.

The size of the MainWindow is read out from the database on opening.

I do not manually change the size of the MainWindow (when open) before the ChildWindow is shown.

Nov 21, 2011 at 6:27 AM

Just to be clear: I mean, once the ChildWindow is open and I then change the size of my MainWindow, it does not dynamically reposition itself.

Nov 28, 2011 at 3:11 PM

Sorry for taking so long to respond.  I have been on vacation.  The behavior you describe is not supported.  If you change the window size while the window is still open, it will not re-center itself.  I could make the CenterChildWindow method public so that you can call it after setting the new size.

Nov 29, 2011 at 7:06 AM

Ok. That would be great. Thank you.

Nov 29, 2011 at 2:12 PM

Can you download the source code and make the change yourself to verify it will work before I make the change?