如何在Windows应用程序中一次打开两个表单c# [英] How to open two forms at a time in Windows Application c#
本文介绍了如何在Windows应用程序中一次打开两个表单c#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在Windows应用程序c#中一次打开两个表单。我的意思是同时在另一个(最大化)表单后面的一个表单(最小化)....
How to open two forms at a time in Windows Application c#..I mean one form(minimised) behind the other(maximised)form at the same time....
推荐答案
向Form1添加一个按钮,在该按钮的处理程序中单击添加:
add a button to Form1 and in the handler of that button click add:
Form2 f2 = new Form2();
this.WindowState = FormWindowState.Minimized;
f2.ShowDialog();
如果你想再次最大化尝试添加
if you want to maximize again try adding
this.WindowState = FormWindowState.Minimized;
。 (如果那不起作用你需要触发Form1捕获的事件。
启动Form2最大化使用相同的原则
after f2.ShowDialog. (if that doesn''t work you''ll need to fire an event that Form1 catches.
to start Form2 Maximized use the same principle
f2.WindowState = FormWindowState.Maximized;
它可能不是100%正确,但应该让你上路。 />
希望这有帮助。
It might not be 100% correct, but should get you on your way.
Hope this helps.
这篇关于如何在Windows应用程序中一次打开两个表单c#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文