call a function from Form to another form using C#.net
Posted By: Narayanan Posted Date: April 18, 2012
Points:5 Category :Windows Application
|
| Hi, Project has a 3 Forms.that is Form1,Form2,Form3.One button is in the Each form.One Function is in the Form that is called Message(). I just call that function from Form3. But It is not worked.
Form1 private void button1_Click(object sender, EventArgs e) { Form2 frm = new Form2(); frm.Show(); }
Function public void message() { pictureBox1.ImageLocation = @"C:\Documents and Settings\User\My Documents\My Pictures\index.JPEG"; }
Form2 private void button1_Click(object sender, EventArgs e) { this.Close(); Form3 frm = new Form3(); frm.Show();
} Form3 Declaration Form1 frm = new Form1;
private void button1_Click(object sender, EventArgs e) {
frm.message(); this.Close(); }
But it is not worked.Please help me.why?I upload a picture in the Picture Box. how to solve this issue?Please do needful...
|
|
You must Sign In To post reply
|