Windows MDI 子窗体标题栏

发布于 2024-09-28 00:42:06 字数 209 浏览 1 评论 0原文

MDI 子窗体在显示时会瞬间显示其标题栏。然后表格就可以正常加载了。有什么方法可以加载表单而不显示标题栏和表单边框。这就是发生的情况...

alt text

替代文字

The MDI child forms, when shown, display their title bars for a split second. Then the forms are loaded normally. Is there any way for the forms to load without showing the title bar and form border. This is what happens...

alt text

alt text

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

捂风挽笑 2024-10-05 00:42:06

不确定我从屏幕截图中看到它。但这种抱怨是一种熟悉的抱怨。 MDI 确实不喜欢最大化的子窗口。当您显示一个新的子窗口并将其最大化时,它需要经历一场歌舞。首先,它恢复当前的子项,使其不再最大化。然后创建新的孩子并将焦点设置在它上面。然后将其最大化。这些中间步骤是可见的,并且在绘制孩子时会产生大量的闪烁,成本很高。你的看起来很贵。你无法压制这幅画。

如果您始终将 MDI 子窗口显示为最大化,则 MDI 是错误的窗体模型。只需使用一个简单的表单,制作子“窗口”用户控件。您甚至可以通过将当前子窗体的 TopLevel 属性设置为 false 来挽救当前的子窗体,这会将它们变成控件。将 FormBorderStyle 设置为 None,并将 Visible 设置为 true。

Not sure I see it from the screenshots. But the complaint is a familiar one. MDI really dislikes a maximized child window. When you display a new child window and make it maximized as well then it needs to go through a song-and-dance. First it restores the current child so it is no longer maximized. Then creates the new child and sets the focus to it. Then maximizes it. Those intermediate steps are visible and can produce a good amount of flicker when drawing the child is expensive. Yours look expensive. You cannot suppress the painting.

If you always display your MDI child windows maximized then MDI is the wrong form model to use. Just use a simple form, make the child 'windows' user controls. You can even rescue your current child forms by setting their TopLevel property to false, that turns them into controls. Set FormBorderStyle to None and Visible to true.

审判长 2024-10-05 00:42:06

即使 MDI 子窗口未最大化,我也遇到这个问题,当显示子窗体时,子窗口的标题栏会立即显示。我通过将子窗体的顶部设置为父窗体的高度来解决这个问题,以便窗体在显示时不可见。然后,我将子项的顶部设置回 0。

直到我尝试将子项停靠在父项中,以便子项会随着父项大小的更改而自动调整大小,该方法才有效。这让我回到了原点。这次我克服了这个问题,方法是向父级添加一个隐藏面板,将面板的大小和位置设置为父级 MdiClient 控件的大小和位置,使面板在显示子级之前可见,并在显示子级时隐藏面板。完成了。 “虽然不太漂亮,但在我找到更好的解决方法之前它会起作用。”

I had this problem even when the MDI child window was not maximized, the child's title bar was momentarily displayed when the child form was shown. I got around it by setting the child form's top to the height of the parent so that the form was not visible while it was being shown. I then set the child's top back to 0.

This worked until I tried to dock the child in the parent so that the child would be automatically resized as the parent's size was changed. This put me back to square one. I overcame the problem this time by adding a hidden panel to the parent, setting the size and position of the panel to the size and postion of the parent's MdiClient control, making the panel visible just before showing the child, and hiding the panel when this is done. 'Not pretty but it works until I can figure out a better way around it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文