我如何重新填写表格 [英] how can i relod the form

查看:73
本文介绍了我如何重新填写表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何显式调用表单的form_load事件....

how can i call the form_load event of the form explicitly ....

推荐答案

您可以使用
You can use the Refresh [^]method.

Else, a dirty trick would be to put all your initialization code into a method and not the constructor or the Form.Load event and just call that method. This can also include the designer-generated InitializeComponent() method which sets up all controls on the form. You should remove all controls on the form as your first action in that method, though.


任何具有signature
的方法
Any method which is has a signature
private void Form1_Load(object sender, System.EventArgs e)

分配给Form Load event,如此处http://msdn.microsoft.com/en-us/library/system.windows.forms.form.load.aspx [ ^ ]

如果method 具有public visibility or access,则可以通过传递如下所示形式的实例从Form instance 调用它

can be assigned to the Load event of the Form as explained here http://msdn.microsoft.com/en-us/library/system.windows.forms.form.load.aspx[^]

If the method has public visibility or access then it can be called from the instance of the Form by passing the instance of the form as shown below

Form1.Form1_Load(Form1, EventArgs.Empty);


这篇关于我如何重新填写表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆