/// <summary>
 /// Recreate the button specifications.
 /// </summary>
 public void RecreateButtons()
 {
     if (_buttonManager != null)
     {
         _buttonManager.RecreateButtons();
     }
 }
예제 #2
0
        private void OnRibbonMdiChildActivate(object sender, EventArgs e)
        {
            // Cast to correct type
            Form topForm = sender as Form;

            // Unhook from watching any previous mdi child
            if (_activeMdiChild != null)
            {
                _activeMdiChild.SizeChanged -= new EventHandler(OnRibbonMdiChildSizeChanged);
            }

            _activeMdiChild = topForm.ActiveMdiChild;

            // Start watching any new mdi child
            if (_activeMdiChild != null)
            {
                _activeMdiChild.SizeChanged += new EventHandler(OnRibbonMdiChildSizeChanged);
            }

            // Update the pendant buttons with reference to new child
            _buttonSpecClose.MdiChild   = _activeMdiChild;
            _buttonSpecRestore.MdiChild = _activeMdiChild;
            _buttonSpecMin.MdiChild     = _activeMdiChild;
            _buttonManager.RecreateButtons();
            PerformNeedPaint(true);

            // We never want the mdi child window to have a system menu, we provide the
            // pendant buttons as part of the ribbon and so replace the need for it.
            PI.SetMenu(new HandleRef(_ribbon, topForm.Handle), NullHandleRef);

            if (_activeMdiChild != null)
            {
                uint windowStyle = PI.GetWindowLong(_activeMdiChild.Handle, -16);
                windowStyle |= PI.WS_SYSMENU;
                PI.SetWindowLong(_activeMdiChild.Handle, -16, windowStyle);
            }
        }
예제 #3
0
 /// <summary>
 /// Recreate the button specifications.
 /// </summary>
 public void RecreateButtons()
 {
     _buttonManager?.RecreateButtons();
 }
 /// <summary>
 /// Recreate the button specifications.
 /// </summary>
 public void RecreateButtons()
 {
     ButtonSpecManager?.RecreateButtons();
 }