delegate void ReportCreatorHandler();
void ReportCreator(Report report, bool isExport, bool isPrint)
{
if (this.InvokeRequired)
{
this.Invoke(new ReportCreatorHandler(delegate() { ReportCreator(report, isExport, isPrint); }));
}
else
{
------;
------;
TForm reportPage = new TForm();
------;
------;
this.tabpages.add(tabpage1);//tabpages is TabPageCollection
}
}
Eventhough i handled "InvokeRequired" in the above code,while adding a tabpage to a TabPageCollection,i am getting an error "Controls created on one thread cannot be parented to a control on a different thread".Also i tried accessing InvokeRequired object on TabPageCollection,property is not there for that collection.Can anyone help in handling the above exception ?? Thanks in advance.