C# 设置最小化窗体的位置

发布于 2024-11-25 10:37:05 字数 327 浏览 1 评论 0原文

我正在用 C# 开发一个应用程序。我有一个主窗体,其中有一些按钮,使用户可以在主窗体中启动新窗体。

当打开更多此类表单并且用户选择最小化其中一个时,它会回到所有打开的表单后面。因此,如果用户想再次打开该表单,他必须关闭/最小化所有表单。(为了能够看到最小化的表单)

我如何管理最小化的表单位置,以便在最小化后它可以可见?我尝试过没有任何结果:bringToFront、Activate、Focus 等。

我的主窗体包含按钮和面板,因此窗体在按钮下方的面板中打开。

在此处输入图像描述

I am developing an application in C#. I have a Main Form where I have some buttons that give the user the possibility to start a new form into the Main Form.

When there are more of this kind of forms opened and the user choose to minimize one, it goes to back behind all opened forms. So if the user would want to open again that form he must close/minimise all forms.(for beeing able to see the minimized one)

How can I manage the minimised form location so it could be visible after it is minimised? I tried without any result stuff like that: bringToFront, Activate, Focus, etc.

My Main Form contains the buttons and a panel, so the forms are opening in the panel bellow the buttons.

enter image description here

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

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

发布评论

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

评论(3

清醇 2024-12-02 10:37:05

你为什么不选择 MDI win-form 呢?我认为它们非常适合您想要实现的目标

http://msdn。 microsoft.com/en-us/library/ms973874.aspx

why don't you go for MDI win-form ? I think they fit really well in what you are trying to achieve

http://msdn.microsoft.com/en-us/library/ms973874.aspx

白龙吟 2024-12-02 10:37:05

最后我自己设法解决了这个问题。就是这么简单。

对于在子面板中打开的表单,我删除了

formName.Dock = DockStyle.Fill;

并设置了 formName.Height = panelContainer-25;现在最小化的小表格就可见了。

Finally I did managed myself to solve the problem. It was so simple.

For the forms that opens in the panel child I removed

formName.Dock = DockStyle.Fill;

and I set the formName.Height = panelContainer-25; So now the little form minimized is visible.

风铃鹿 2024-12-02 10:37:05

我知道这是迟到的帖子,但可能对像我这样的人有用。
试试这个,这对我来说也可以设置最小化窗口位置和大小

https://social.msdn.microsoft.com/Forums/windows/en-US/d6014e48-2adb-4096-8bea-94c2f3b1c47c/how-to-change-the-location-of-a-minimized-mdichild-form?forum=winforms

I know this is late post but might be useful for someone like me.
Try this this was working for me to set minimized window location and size as well

https://social.msdn.microsoft.com/Forums/windows/en-US/d6014e48-2adb-4096-8bea-94c2f3b1c47c/how-to-change-the-location-of-a-minimized-mdichild-form?forum=winforms
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文