コード例 #1
0
        private void ShowModalPanel(Control panel, bool slideIn, eSlideSide slideFromSide, int animationTimeMilliseconds)
        {
            StyleManager.UpdateAmbientColors(panel);

            SlidePanel slidePanel = new SlidePanel();
            slidePanel.CenterContent = true;
            slidePanel.AnimationTime = animationTimeMilliseconds;
            slidePanel.SlideSide = slideFromSide;
            slidePanel.SlideOutButtonVisible = false;

            if (slideIn)
            {
                slidePanel.Bounds = GetModalPanelBounds();
                slidePanel.SlideOutOfViewSilent(this);
            }
            else
            {
                slidePanel.Bounds = GetModalPanelBounds();
            }

            slidePanel.Controls.Add(panel);
            this.Controls.Add(slidePanel);
            this.Controls.SetChildIndex(slidePanel, 0);
            _ModalPanels.Add(slidePanel);

            if (_ModalPanels.Count == 1 && _MetroTab != null)
            {
                //_MetroTab.MetroTabStrip.Enabled = false;
                _MetroTab.MetroTabStrip.StripContainerItem.Enabled = false;
                for (int i = 0; i < _MetroTab.MetroTabStrip.CaptionContainerItem.SubItems.Count; i++)
                {
                    BaseItem item = _MetroTab.MetroTabStrip.CaptionContainerItem.SubItems[i];
                    if (item.SystemItem && !(item is QatCustomizeItem)) continue;
                    item.Enabled = false;
                    _DisabledItemIds.Add(item.Id);
                }
                _MetroTab.MetroTabStrip.Invalidate();
            }

            this.Update();
            if (slideIn)
                slidePanel.IsOpen = true;

        }
コード例 #2
0
ファイル: SliderButton.cs プロジェクト: huamanhtuyen/VNACCS
 /// <summary>
 /// Initializes a new instance of the SliderButton class.
 /// </summary>
 /// <param name="slidePanel"></param>
 public SliderButton(SlidePanel slidePanel)
 {
     _SlidePanel = slidePanel;
     this.Margin = new System.Windows.Forms.Padding();
 }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: Thomas-Matheus/GLauncher
 private void UpdateControlsSizeAndLocation(SlidePanel Main)
 {
     if (Main != null)
     {
         if (!Main.IsOpen)
             Main.OpenBounds = GetStartControlBounds();
         else
             Main.Bounds = GetStartControlBounds();
         if (!IsModalPanelDisplayed)
             Main.BringToFront();
     }
 }