internal void MoveTabsTo(DockedTabControl target)
        {
            var children = TabStrip.Children.ToArray(); // copy because collection will be modified

            foreach (ControlBase child in children)
            {
                TabButton button = child as TabButton;
                if (button == null)
                {
                    continue;
                }
                target.AddPage(button);
            }
            Invalidate();
        }
Exemple #2
0
        protected override Size OnMeasure(Size availableSize)
        {
            int num = 0;

            foreach (var child in Children)
            {
                TabButton button = child as TabButton;
                if (null == button)
                {
                    continue;
                }

                Margin m        = new Margin();
                int    notFirst = num > 0 ? -1 : 0;

                switch (this.StripPosition)
                {
                case Dock.Top:
                case Dock.Bottom:
                    m.Left = notFirst;
                    break;

                case Dock.Left:
                case Dock.Right:
                    m.Top = notFirst;
                    break;
                }

                button.Margin = m;
                num++;
            }

            m_TotalSize = base.OnMeasure(Size.Infinity);

            return(m_TotalSize);
        }
Exemple #3
0
 public void UpdateFromTab(TabButton button)
 {
     Text = button.Text;
 }