I've developed a WinForms application that allows users to create a number
of child forms within a larger parent form. The child forms can be dragged
around within the bounds of the parent. They can also be resized.
When the user closes the application, I want the size and position of the
child forms to be persisted. I've figured out how to do this. The only thing
I'm lacking is the z-order. How do I determine the z-order of each child
form relative to its siblings? If I could find a way to persist this
information, then when the app starts up again, I could arrange the forms
with the same z-order that the user used in the previous session.
Thanx..
Sergey Poberezovskiy - 28 Dec 2005 22:10 GMT
The ActiveForm will always be on top - so when you close your application
just record the activeform's order as you close them - hope it makes sense.
> I've developed a WinForms application that allows users to create a number
> of child forms within a larger parent form. The child forms can be dragged
[quoted text clipped - 8 lines]
>
> Thanx..
Tim Scott - 29 Dec 2005 03:52 GMT
Jules,
The Z-Order is controlled by the order of the controls in the parent
control's Control collection. As long as you serialize out and then
back in with the same order, the Z-Order should be preserved.
See this post:
http://groups.google.com/group/microsoft.public.dotnet.framework.windowsforms/br
owse_thread/thread/21ba1a662a032356/
-- Tim Scott
http://geekswithblogs.net/tscott
Jules Winfield - 29 Dec 2005 12:33 GMT
Thanks -- that's precisely what I was looking for!
> Jules,
>
[quoted text clipped - 7 lines]
> -- Tim Scott
> http://geekswithblogs.net/tscott