问题
I have been working on a project in C#, a portion of it requires multiple instances of a window to open. Is there any easy way to cascade the instances of the form? I'm assuming I'd have to deal with the math required manually. I just cannot wrap my head around it, any comments or suggestions would be greatly appreciated.
回答1:
If I understand you correctly, you want the forms to appear on screen in a cascade effect:

If so, when using WinForms you can do this by ensuring that the StartPosition property of each form is set to FormStartPosition.WindowsDefaultLocation
(which it is by default).
If you are using WPF, you need to set the WindowStartupLocation property to WindowStartupLocation.Manual
in a similar manner and not set a specific location for the window.
This leaves Windows to position the form when it displays, which it does by using the cascading effect shown in the picture.
来源:https://stackoverflow.com/questions/5560081/c-sharp-cascading-forms-without-mdi-parent