Exemplo n.º 1
0
        /// <summary>
        /// Raises top control changed event
        /// </summary>
        /// <param name="oldControl">old control</param>
        /// <param name="newControl">new control</param>
        private void OnTopControlChnaged(Control oldControl, Control newControl)
        {
            EventHandler <ControlSwitchedEventArgs> handler = TopControlChanged;

            if (handler != null)
            {
                ControlSwitchedEventArgs args = new ControlSwitchedEventArgs(oldControl, newControl);
                handler(this, args);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// On top form changed
        /// </summary>
        /// <param name="sender">sender of the event</param>
        /// <param name="e">e</param>
        private void OnTopFormChanged(object sender, ControlSwitchedEventArgs e)
        {
            if (e.OldControl != null)
            {
                e.OldControl.Resize -= OnTopFormResize;
            }

            SetFormsPanelBounds();
            ApplyTopFormMargins();

            if (e.NewControl != null)
            {
                e.NewControl.Resize += OnTopFormResize;
            }

            return;
        }