if (mdm.Forms.thisForm.width >=mdm.System.screenWidth) mdm.Application.restore(); else mdm.Application.maximize();