我正在从我的父表单中调用一个表单的 ShowDialog,并且我正在填充子表单中的一些数据,我想通过它在我的父表单中调用一个方法。
我父表单中的方法更新我表单中的控件值。
这导致我出现线程中止异常
说喜欢
ChildForm Cform=new ChildForm();
Cform.ShowDialog();
在 ChildForm 中
ParentForm PForm=new Parentform();
PForm.Somemethod();//method in my parentForm
在某种方法中,我通过调用来更新表单中控件的值
我正在调用每个控件,但仍然收到ThreadAbort 异常
注意:我正在使用 Compact Framework
//My parent Form Method
public void ProcessResponse()
{
Result Objresult = new Result();
Objresult.ShowDialog();
}
//My child Form
public void SendBackResponse()
{
//Some Processing
ParentForm PForm=new Parentform();
PForm.Somemethod();
}
And In ParentForm I am having
public void Somemethod()
{
if(InvokeRequired)
{
//I am invoking Through the delegate
}
}
提前致谢