by Mike.Sheen » Fri Jan 17, 2020 9:17 am
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.
Mike Sheen
Chief Software Engineer
Jiwa Financials
If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution