/// <summary>
        /// Called when helped form is activated
        /// </summary>
        /// <param name="sender">Object that raised the event</param>
        /// <param name="e">Event data</param>
        protected virtual void Form_Load(object sender, EventArgs e)
        {
            if (DesignMode) return;
            WinApi.MARGINS dwmMargins = new WinApi.MARGINS(
                Margins.Left,
                Margins.Right,
                Margins.Bottom + ((Ribbon.OrbStyle == RibbonOrbStyle.Office_2007) ? Ribbon.CaptionBarHeight : Ribbon.CaptionBarHeight + Ribbon.TabsMargin.Top),
                Margins.Bottom);

            if (WinApi.IsVista && !_frameExtended)
            {
                WinApi.DwmExtendFrameIntoClientArea(Form.Handle, ref dwmMargins);
                _frameExtended = true;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Called when helped form is activated
        /// </summary>
        /// <param name="sender">Object that raised the event</param>
        /// <param name="e">Event data</param>
        protected virtual void Form_Activated(object sender, EventArgs e)
        {
            if (DesignMode) return;
             WinApi.MARGINS dwmMargins = new WinApi.MARGINS(
             Margins.Left,
             Margins.Right,
             Margins.Bottom + Ribbon.CaptionBarHeight,
             Margins.Bottom);

             if (WinApi.IsVista && !_frameExtended)
             {
            WinApi.DwmExtendFrameIntoClientArea(Form.Handle, ref dwmMargins);
            _frameExtended = true;
             }
        }