Hi Selva,
Thank you for posting. From your post, my understanding on this issue is:
how to update contents in Form1 and Form2 when the Product name in Form3
changed. If I'm off base, please feel free to let me know.
You can define an event for the change of the product name and write a
method to trigger the event when the product name changes in Form3. Then
subscribe the event and define corresponding event handling methods in
Form1 and Form2. Thus when the product name in Form3 changes, the event
will be raised and the corresponding event handling methods in Form1 and
Form2 will be called.
The following is a sample.
// event defined in Form3
public delegate void ProductNameChangedEventHandler(int productID);
public event ProductNameChangedEventHandler EvtProductNameChanged;
private void OnProductNameChanged(int id)
{
if (EvtProductNameChanged != null)
{
EvtProductNameChanged(id);
}
}
// add reference variable of a instance of Form3 ,subscribe the event and
define the handling method
public Form3 frm3 = null;
public Form1()
{
InitializeComponent();
frm3.EvtProductNameChanged += new
Form3.ProductNameChangedEventHandler(frm3_EvtProductNameChanged);
}
void frm3_EvtProductNameChanged(int productID)
{
// add your update process here
}
You should assign the instance of Form3 to the reference variable "frm3"
of Form1 in the MDI Parent.
Hope this is helpful to you.
Please don't hesitate to tell me if you have any other concerns, or need
anything else.
Sincerely,
Linda Liu
Microsoft Online Community Support
====================================================
When responding to posts,please "Reply to Group" via
your newsreader so that others may learn and benefit
from your issue.
====================================================