Groups | Blog | Home
all groups > c# > february 2004 >

c# : Multi-forms accessing problem


Peter Rilling
2/3/2004 4:07:19 PM
If you truly want to define a parent-child relationship between the forms,
you could pass the parent form into the child form's constructor. Or you
could just pass whatever information you want to the forms constructor, like
the DataSet.

[quoted text, click to view]

pei_world
2/3/2004 11:46:17 PM
Hi there,
I have a application with multi-forms.
The situation is that Form A(have a Dataset) is a base window,click one
button to instiniate Form B(use the Database from Form A, Update the Dataset
after something changed), How can I access to the dataset in Form A,
supposed Form A is also a child form of another form. like:

(Other Form (Form A{Dataset}(Form B)))

Basically, How can I use Form A from other form?

thanks

pei

Benjamin Wootton
2/4/2004 1:31:28 AM
[quoted text, click to view]

In each form you can maintain a list of references to other forms,
right? And then when data changes, send a message to all of the other
forms.

You might also want to check out the Observer design pattern which
will prevent the need for any kind of polling.

HTH
Ben

AddThis Social Bookmark Button