Esempio n. 1
0
        private void Handler_ControlAdded(object theSender, ControlEventArgs theArgs)
        {
            if (theArgs.Control is MultiPanePage)
            {
                MultiPanePage aPg = (MultiPanePage)theArgs.Control;

                // prevent the page from being moved and/or sized independently
                aPg.Location = new Point(0, 0);
                aPg.Size     = ClientSize;
                aPg.Dock     = DockStyle.Fill;

                if (SelectedPage == null)
                {
                    SelectedPage = aPg;
                }
                else
                {
                    aPg.Visible = false;
                }
            }
            else
            {
                //silently remove
                Controls.Remove(theArgs.Control);
            }
        }
Esempio n. 2
0
 public MultiPanePageItem(MultiPanePage thePg)
 {
     myPage = thePg;
 }
Esempio n. 3
0
        private void Handler_SelectedPageChanged(object theSender, EventArgs theArgs)
        {
            mySelectedPage = DesignedControl.SelectedPage;

            // We do not call the property here, because the control
            // has already updated pages' visibility. We only must
            // sync the field with the control's current selection
        }
Esempio n. 4
0
 private void Handler_OK(object sender, EventArgs e)
 {
     myFutureSelectedItem = ((MultiPanePageItem)myCtlCmbItems.SelectedItem).Page;
     mySetSelectedPage = myCtlChkSetSelectedPage.Checked;
 }
Esempio n. 5
0
 /// <summary>
 /// Focus the single control, when it is the only one on the specified page.
 /// </summary>
 /// <param name="page">The page.</param>
 /// <remarks>Documented by Dev02, 2008-04-23</remarks>
 private void FocusSingleControl(MultiPanePage page)
 {
     if (page != null && page.Controls.Count == 1)
         page.Controls[0].Focus();
 }