如何在c#.net中单击按钮时获取另一个表单 [英] how to get the another form when button is clicked in c#.net
本文介绍了如何在c#.net中单击按钮时获取另一个表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在form1中单击一个按钮时获取另一个表单,并且form2包含C#.net中的其他信息。
解决方案
>
在按钮上创建Form2的对象单击并调用ShowDialog()方法。
private void button1_Click( object sender,EventArgs e)
{
Form2 frm = new Form2();
frm.ShowDialog();
}
请阅读以下链接以减少您的问题...
http:// stackoverflow。 com / questions / 3965043 /如何从另一种形式开放新形式 [ ^ ]
http://msdn.microsoft.com/en-us/library/ws1btzy8(v = vs.90).aspx [ ^ ]
https ://www.youtube.com/watch?v = LWoE7P4RHFM [ ^ ]
谢谢
AARIF SHAIKH
how to get the another form when one button is clicked in the form1 and that form2 contains some other information in C#.net
解决方案
Hi,
Create object of Form2 on button Click and call ShowDialog() method.
private void button1_Click(object sender, EventArgs e) { Form2 frm=new Form2(); frm.ShowDialog(); }
Please Read below links for reducing your problem...
http://stackoverflow.com/questions/3965043/how-to-open-a-new-form-from-another-form[^]
http://msdn.microsoft.com/en-us/library/ws1btzy8(v=vs.90).aspx[^]
https://www.youtube.com/watch?v=LWoE7P4RHFM[^]
Thanks
AARIF SHAIKH
这篇关于如何在c#.net中单击按钮时获取另一个表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文