C# 设置最小化窗体的位置
我正在用 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你为什么不选择 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
最后我自己设法解决了这个问题。就是这么简单。
对于在子面板中打开的表单,我删除了
并设置了 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
and I set the formName.Height = panelContainer-25; So now the little form minimized is visible.
我知道这是迟到的帖子,但可能对像我这样的人有用。
试试这个,这对我来说也可以设置最小化窗口位置和大小
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