V
Vaughn
When I pass a reference to my current form, frm_x, when I create and show
another form, frm_y, do I have access to all of the public methods,
controls, members, etc.. of frm_x from frm_y?
In my code, I pass the reference like this:
private void btn_ListEmp_Click(object sender, System.EventArgs e)
{
frm_EmpList frm_empList = new frm_EmpList(this);
frm_empList.MdiParent = this.MdiParent;
frm_empList.Show();
}
---------------------
public Form _frm_emplRec;
public frm_EmpList(DataSet DS_allEmployees, Form frm_emplRec)
{
InitializeComponent();
_frm_emplRec = frm_emplRec;
//_frm_emplRec.txt_ssNum.Text = "MyText"; /* This doesn't compile
although txt_ssNum is public*/
}
How can I pass a reference of the form *and* have control of anything public
inside the form?
Also, is this the best way to pass values from one form to another? If not,
what other option could I use?
Thanks again,
Vaughn
another form, frm_y, do I have access to all of the public methods,
controls, members, etc.. of frm_x from frm_y?
In my code, I pass the reference like this:
private void btn_ListEmp_Click(object sender, System.EventArgs e)
{
frm_EmpList frm_empList = new frm_EmpList(this);
frm_empList.MdiParent = this.MdiParent;
frm_empList.Show();
}
---------------------
public Form _frm_emplRec;
public frm_EmpList(DataSet DS_allEmployees, Form frm_emplRec)
{
InitializeComponent();
_frm_emplRec = frm_emplRec;
//_frm_emplRec.txt_ssNum.Text = "MyText"; /* This doesn't compile
although txt_ssNum is public*/
}
How can I pass a reference of the form *and* have control of anything public
inside the form?
Also, is this the best way to pass values from one form to another? If not,
what other option could I use?
Thanks again,
Vaughn