SBarnes wrote:You don't have to the following works in the after form start
- Code: Select all
if(JiwaForm.Manager.MDIParentForm.MdiChildren.Length > ApplicationManagerPlugin.FormLimit)
{
System.Windows.Forms.MessageBox.Show("You can't open more than " + ApplicationManagerPlugin.FormLimit.ToString() + " forms");
JiwaForm.Form.Close();
throw new JiwaFinancials.Jiwa.JiwaApplication.Exceptions.ClientCancelledException();
}
Ok, great - but still going to fix the issue where the BeforeFormStart event does not fire in the FormFactory, because that's what it was created explicitly for! Would also be more efficient to do that rather than cancel after loaded... and because it will be pretty confusing to the user if the form loads, a message box or something is displayed (often people have message boxes displayed when a record with certain data values is loaded), and then the form disappears.