problem with multi-forms data communication

  • Thread starter Thread starter pei_world
  • Start date Start date
P

pei_world

hi
I have a app with one MDIparent and many MDIchildren forms
I want to know a way such that those MDIchildren forms can communicate
freely.
I means, call any public function without creating an instance of the
children form.
is this possible?
please tell me in details!
thanks
 
Where are the public methods? If in the parent, then your MDIchildren have
the parents form reference and can use that to call only public method or
property.
 
it is in one of my MDIchild form, and I call this public function in other
class file or other MDIChild form.
 
I think the mdiparent maintanes a collection of mdichildren, if so, you can
enum that to get the ref of the mdichild form your interested in and call
the method. You can always create your own collection in the parent and add
child refs to it when they are created and make that collection a public
property of the parent. You can use just a Form[] or create another class
that holds more info (i.e. child desc, number, purpose, etc.) and make that
a collection inside the parent. hth
 
can you please give me some sample code?
if use enum, then will the app becomes fix. I want to make it generic later.
 
By enum, I meant enumerate the collection - not use an enum - sorry. I will
look for some code (I did something like this once.)

William Stacey said:
I think the mdiparent maintanes a collection of mdichildren, if so, you can
enum that to get the ref of the mdichild form your interested in and call
the method. You can always create your own collection in the parent and add
child refs to it when they are created and make that collection a public
property of the parent. You can use just a Form[] or create another class
that holds more info (i.e. child desc, number, purpose, etc.) and make that
a collection inside the parent. hth

--
William Stacey, MVP

pei_world said:
it is in one of my MDIchild form, and I call this public function in other
class file or other MDIChild form.
 
Back
Top