moved registering of mainform from ctor to mainform.load event, because designmode property is not set in the ctor (ticket #771)