There are a number of ways, more are prolly more correct than the one I
propose.
I like to keep the state of the data seperate from the forms. So in this
case I would create a state object that is shared among the forms. I then
register to receive event notification from this shared object. There are a
couple of ways to do this as well. Here is one way.
public class DataState
event Dataupdated(sender as object, e as eventargs)
private shared objDataState as DataState
shared Sub new
objdatastate = new DataState
end sub
public shared readonly property Instance as DataState
get
return pobjdatastate
end get
end property
end Class
public class Form1
public sub new
'after initialize
addhandler datastate.instance.DataUpdate, addressof OnDataUpdate
end sub
private sub OnDataUpdate(sender as object, e as eventargs)
'Handle event here
end sub
end class
The IssueVision project on
www.windowsforms.com has another way of
implementing notifications between forms.
"sonicm" <so****@discussions.microsoft.comwrote in message
news:49**********************************@microsof t.com...
Can anyone tell me how an MDI parent can fire an event that the child
window
can pick up?
We have a MDI parent window containing 2 child windows (named 1 and 2).
Child window 2 updates and fires an event to say it has updated that the
main
MDI parent can pick up on. I cannot find a way for the MDI parent to say
to
Child window 1 that Child Window 2 has been updated?
Any help would be appreciated?
Thanks
mike