C# 没有 mdi 父级的级联表单?
我一直在用 C# 开发一个项目,其中一部分需要打开一个窗口的多个实例。有没有简单的方法来级联表单的实例?我假设我必须手动处理所需的数学。我只是无法理解它,任何评论或建议将不胜感激。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我理解正确的话,您希望表单以级联效果出现在屏幕上:
如果是这样,在使用 WinForms 时您可以通过确保
StartPosition
属性设置为FormStartPosition.WindowsDefaultLocation
(默认情况下)。如果您使用的是 WPF,则需要设置 <以类似的方式将 code>WindowStartupLocation 属性设置为
WindowStartupLocation.Manual
,并且不为窗口设置特定位置。这使得 Windows 在窗体显示时定位窗体,这是通过使用图中所示的级联效果来实现的。
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 toFormStartPosition.WindowsDefaultLocation
(which it is by default).If you are using WPF, you need to set the
WindowStartupLocation
property toWindowStartupLocation.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.