I have a windows Parent Form that invokes child form threads. Each child form does some processing and when its done, the child form needs to access a method on the parent form.
Can some one tell me how can I accomplish this ? I am trying this for the first time and didnt see any examples on the net.
Any help or pointers to an example source code will be much appreciated.
Do you use like form2.show() to invoke child form? If so , i think you can pass the reference of the parent form when invoking the child form form2.show(this), and you can call the public method in the parent form.
Assume form1 is the parent form ,form2 is the child form.
In form1.cs :
hope that help.
Thanks guys for the suggestions.
On child thread Im spawning client created dynamic assemblies. My client doesnt need to know anything about parent implementation.
Harry - This is in regards to threads (parents and child) not forms exactly although my child threads do invoke assemblies of type Forms.
Haider & Sethluri, let me try out your suggestions but it seems even using the delegates I still have to reference parent assembly.
So my original question still stands.
As I learnt from your post ,you are trying to access a method on the parent form. I think we can just call it as it is public . The following code snippet works:
Could you also share with us that What effect would you like to get and some code?maybe
some community members have some idea on it.