简体   繁体   English

C# 设置最小化表格的位置

[英]C# set location of a minimized form

I am developing an application in C#.我正在 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.当此类 forms 打开的数量较多且用户选择最小化一个时,它会回到所有打开的 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)因此,如果用户想再次打开该表单,他必须关闭/最小化所有 forms。(因为能够看到最小化的)

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.我尝试过没有任何结果的东西:bringToFront、Activate、Focus 等。

My Main Form contains the buttons and a panel, so the forms are opening in the panel bellow the buttons.我的主窗体包含按钮和面板,因此 forms 在按钮下方的面板中打开。

在此处输入图像描述

why don't you go for MDI win-form?你为什么不用 go 来做 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 http://msdn.microsoft.com/en-us/library/ms973874.aspx

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试试这个,这对我来说也可以设置最小化的 window 位置和大小


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

Finally I did managed myself to solve the problem.最后我确实设法解决了这个问题。 It was so simple.就这么简单。

For the forms that opens in the panel child I removed对于在面板子中打开的 forms,我删除了

formName.Dock = DockStyle.Fill;

and I set the formName.Height = panelContainer-25;我设置了 formName.Height = panelContainer-25; So now the little form minimized is visible.所以现在最小化的小表格是可见的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM