MyForm oForm = new MyForm();
oWinMgr.OpenForm(oForm);
And your WinMgr code would then be:public class WinMgr { // Count of windows open int iWinCount = 0; // Array to hold window instances object[] Windows; public void OpenForm(Form oForm) { // Increment the window count iWinCount++; // Resize the array to hold the new form instance Windows = new object[iWinCount]; // Store the instance of the form to the array Windows[iWinCount] = oForm; // Display the form oForm.Show(); } }That should work.
>MyForm oForm = new MyForm();
>
>> public class WinMgr > { > // Count of windows open > int iWinCount = 0; > > // Array to hold window instances > object[] Windows; > > public void OpenForm(string sFormName) > { > > // Increment the window count > iWinCount++; > > MyForm oForm = new MyForm(); > > // Resize the array to hold the new form instance > Windows = new object[iWinCount]; > > // Store the instance of the form to the array > Windows[iWinCount] = oForm; > > // Display the form > oForm.Show(); > > } > > } >