Accessing child form property in C# window's forms
<p>So I am trying to access a public member variable of my child form from its parent form.  The form has a public get property from which I am trying to access the variable.  Here is how the variable is defined in my child form:</p>

<pre><code>    public partial class frmNewProduct : Form
{
    public Inventory _inventory { get; private set; }
</code></pre>

<p>Now let's switch pace and go to the parent form.  The instance of the child form is created below, and you can also see me trying to access _iventory's get property from that instance, but I receive compiler errors every time.</p>

<pre><code>        private void btnAdd_Click(object sender, EventArgs e)
    {
        Form newProduct = new frmNewProduct(_inventory, Mode.add);
        newProduct.Show();
        Inventory variable = newProduct._inventory;
    }
</code></pre>

<p>The compiler error reads the following: </p>

<p>Error   1   'System.Windows.Forms.Form' does not contain a definition for '_inventory' and no extension method '_inventory' accepting a first argument of type 'System.Windows.Forms.Form' could be found (are you missing a using directive or an assembly reference?)</p>

<p>Does anyone know what is wrong here?  Thank you.</p>
