如何找到 MDI 父窗体的内容区域?
我想知道 MDI 父级中灰色可滚动区域的边界 - MDI 子级放置/排列的区域。我不希望它包含任何菜单、滚动条或状态区域——只是灰色区域。
this.mdiForm.ClientRectangle 给出了表单的整个内部,包括滚动条等,这不是我想要的。
I want to know the bounds of the grey scrollable area in an MDI parent -- the area in which MDI children are placed/arranged. I don't want it to include any menu, scroll bars, or status areas -- just the grey area.
this.mdiForm.ClientRectangle
gives the whole interior of the Form, including scroll bars et al, which is not what I want.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
该控件名为 MdiClient,它会自动当 IsMdiContainer 属性设置为 true 时添加。您应该能够通过执行以下操作来访问它:
The control is called MdiClient and it's automatically added when the IsMdiContainer property is set to true. You should be able to access it by doing:
一如既往,在发帖后,我就明白了。
Form
有一个内部属性MdiClient
。因此,您可以得到这样的矩形:当然,生产版本会在适当的位置检查 null 。
As always, just after posting, I figure it out.
Form
has an internal propertyMdiClient
. So, you can get the rectangle like this:A production version would, of course, check for null in the appropriate places.