Note that there are some explanatory texts on larger screens.

plurals
  1. POGet value from parentform
    text
    copied!<p>In my application, I have a mainform which is the MdiParent of all other forms. On login, by default this form is opened and from menustrip in this form we are navigating to other forms like this: </p> <pre><code>public partial class MainMenuForm : Form { public MainMenuForm() { InitializeComponent(); this.WindowState = FormWindowState.Maximized; } private void humanResourceToolStripMenuItem_Click(object sender, EventArgs e) { HumanResourceForm humanresourceform = new HumanResourceForm(); humanresourceform.MdiParent = this; humanresourceform.Show(); } } </code></pre> <p>Inside the <code>HumanResourceForm</code> I have a button which will navigate to another form say <code>EmployeeTransferForm</code>:</p> <pre><code>private void button1_Click(object sender, EventArgs e) { Administraror.Humanresource.EmployeeTransferForm emptranfrm = new Administraror.Humanresource.EmployeeTransferForm(); emptranfrm.ShowDialog(); } </code></pre> <p>Now my problem is inside the <code>EmployeeTransferForm</code> I want to get some values from the controls of <code>HumanResourceForm</code>. Also the user should not be allowed to close the HumanResourceForm when the <code>EmployeeTransferForm</code> is open or active.</p> <p>I also want to get the Text property of a TextBox of <code>HumanResourceForm</code> in <code>EmployeeTransferForm</code> like:</p> <pre><code>public partial class EmpLoctnChangeForm : Form { public EmpLoctnChangeForm( ) { InitializeComponent(); } private void EmpLoctnChangeForm_Load(object sender, EventArgs e) { intemppk = humanresourceform.txtpk.text; } } </code></pre> <p>Expecting some nice advice from all.<br> Thanks in advance.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload