May 31st, 2010, 12:55 AM
Accessing Objects Between Forms
I'm fairly new to C# and have run into a problem. I have one form mainForm which creates a new form optionsForm when a button is clicked.
private void button_Click(object sender, EventArgs e)
Options optionsForm = new Options(this);
DialogResult result = optionsForm.ShowDialog(this);
In the optionsForm, I've tried to pass mainForm by reference so I could access its objects.
private form_VisionSystem mainForm = null;
public Options(Form callingForm)
mainForm = callingForm as form_VisionSystem;
I would like to access an object from mainForm and that object's methods from optionsForm. Is this possible, and if so how could I go about achieving this.
Any help would be greatly appreciated.
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.