Hello,
You can try passing on the image from Form1 to Form2 when the Form2 is loaded. After modifications, pass on the
modified image back to Form1 on the FormClosing() event of Form2.
Lets say we have a Picture box on Form1. We will pass on the image on Form2 and after modifications, put the
image back on PictureBox after form2 is closed.
1. Declare public variables in Form2.
Form1 _frm;
Image _img;
2. Create a Function in Form2
CODE
public void ShowForm(Form1 frm, Image img)
{
_frm = frm;
_img = img;
this.Show();
}
3. After modifications, pass on the image back in FormClosing Event
CODE
private void Form2_FormClosing(object sender, FormClosingEventArgs e)
{
_frm.C1FlexGrid1[1, 1] = "Testing only";
_frm.PictureBox1.Image = _img;
}
In Form1 you can call the Form2 in the following manner:
CODE
Form2 frm = new Form2();
frm.ShowForm(this, this.PictureBox1.Image);
I hope this will help.
Regards,
Allen
This post has been edited by allensmith: 5 Jun, 2008 - 01:06 AM