C# ref Polymorphism workaround
<p>I've made a function in C#:</p>

<pre><code>private void customShow(Form someForm, Type formType) {
    if (someForm == null || someForm.IsDisposed) someForm = (Form)Activator.CreateInstance(formType);
    someForm.StartPosition = FormStartPosition.CenterScreen; 
    someForm.MdiParent = this;
    someForm.Show();
    someForm.WindowState = FormWindowState.Maximized;
}
</code></pre>

<p>And then I wanted to do this:</p>

<pre><code>private void mnuKategori_Click(object sender, EventArgs e) {
    customShow(frmKategori, typeof(Master.FrmKategori));
    frmKategori.isCRUD = true;
}
</code></pre>

<p>It failed on the method's second line because the variable frmKategori is still null after the method execution. If I make the "someForm" argument into reference, it also fails because it seems C# doesn't support polymorphism with "ref" and "out" keyword. Does anybody have a suggestion on this?
Thanks in advance for the reply.</p>
