Trying to call methods between classes created dynamically
<p>I have been trying to work out how to call a method in a different class. Both classes are created dynamically at run-time. Most of the issues I have seen here relate to inheritance, which is different from what I have (I think.)</p>

<p>I am still fairly new to C#, and am trying to test some concepts out.</p>

<p>The first class is something like this:</p>

<pre><code>public class Record
{
    CustomPanel _panel;

    public void recordFunc(){}
}
</code></pre>

<p>The internally created class has something like this:</p>

<pre><code>public class CustomPanel : Panel
{
    List&lt;Control&gt; _myControls = new List&lt;Control&gt;;
    // _myControls[0] += new EventHandler(myFunc);

    public void myFunc(object sender, EventArgs e)
    {
        // parentClass.recordFunc();
    }
}
</code></pre>

<p>My objective is to create a Record at run-time from a database call. At that point, it creates a Panel (from my CustomPanel class) that gets added to a FlowLayoutControl. When events are fired from the panel's internal controls, I need to have it update parts of the parent Record class.</p>

<p>Any help is greatly appreciated.</p>
