重装windows窗体无需关闭并重新打开 [英] Reloading windows form without closing and reopening
本文介绍了重装windows窗体无需关闭并重新打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经写在C#中的Windows窗体应用程序。我想重装形式,当有人按其中的清除按钮。但我无法实现调用加载event.These线也没工作:
this.Refresh();
this.Load + =新的EventHandler(Grafik_Load); //'创艺'是表单的名称。
我应该怎么处理这件事?感谢您的帮助..
解决方案
私人无效callonload()
$ { b $ b //代码其中U wrriten负载事件
}
私人无效的Form_Load(对象发件人,EventArgs五)
{
callonload();
}
私人无效btn_clear_Click(对象发件人,EventArgs五)
{
callonload();
}
I have an windows forms application written in c#. I want to reload form when someone press the "clear" button in it. But I couldn't achieve to call Load event.These lines didn't also work :
this.Refresh();
this.Load +=new EventHandler(Grafik_Load); // 'Grafik' is the name of the form.
What should I do about this? Thanks for helping..
解决方案
private void callonload()
{
//code which u wrriten on load event
}
private void Form_Load(object sender, EventArgs e)
{
callonload();
}
private void btn_clear_Click(object sender, EventArgs e)
{
callonload();
}
这篇关于重装windows窗体无需关闭并重新打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文