Пример #1
0
        /// <summary>
        ///     Actually handles the subform swap
        /// </summary>
        /// <param name="mSubForm"> The sub form you want to load into the SwapPanel </param>
        private void SetSubForm(ISwapPanelSubForm mSubForm)
        {
            if (SwapPanel.Controls.Count > 0)
            {
                //Selection already set
                if (SwapPanel.Controls[0] == mSubForm)
                {
                    return;
                }

                //Clear existing control
                SwapPanel.Controls.Clear();
            }

            SetPageTitle("");

            //Set anchor so sub form can shrink and grow
            ((UserControl)mSubForm).Anchor = (AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top);
            SwapPanel.Controls.Add((Control)mSubForm);
        }
Пример #2
0
        /********************************
        * Public interface
        ********************************/

        public void ChangeSubForm(ISwapPanelSubForm newSubForm)
        {
            mMenu.ClearMenuSelection(); //Clear the active menu selection
            SetSubForm(newSubForm);
        }