Click here to Skip to main content
15,886,518 members

Comments by medlteam (Top 1 by date)

medlteam 2-Jun-10 4:05am View    
Thx for ur answer but i get new error
what i did
public DialogResult dr;
private delegate void InvokeDelegate(CButtonedForm parent);
public void CustShowDialog(CButtonedForm parent)
{
InvokeDelegate d = new InvokeDelegate(CustShowDialog);
object[] o=new object[] { parent};
if (parent.InvokeRequired)
{
dr= (DialogResult)parent.Invoke(d,o );
}
else
{
dr = this.ShowDialog(parent);
}
}
but when i am tring to close MessageBox i am getting an error
Object reference not set to an instance of an object.
in this line
dr= (DialogResult)parent.Invoke(d,o );
what is the solution