コード例 #1
0
        public FATabStrip()
        {
            BeginInit();

            SetStyle(ControlStyles.ContainerControl, true);
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.ResizeRedraw, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            SetStyle(ControlStyles.Selectable, true);

            items = new FATabStripItemCollection();
            items.CollectionChanged += OnCollectionChanged;
            base.Size = new Size(350, 200);

            menu                 = new ContextMenuStrip();
            menu.Renderer        = ToolStripRenderer;
            menu.ItemClicked    += OnMenuItemClicked;
            menu.VisibleChanged += OnMenuVisibleChanged;

            menuGlyph   = new FATabStripMenuGlyph(ToolStripRenderer);
            closeButton = new FATabStripCloseButton(ToolStripRenderer);
            Font        = defaultFont;
            sf          = new StringFormat();

            EndInit();

            UpdateLayout();
        }
コード例 #2
0
 public virtual void Assign(FATabStripItemCollection collection)
 {
     BeginUpdate();
     try
     {
         Clear();
         for (int n = 0; n < collection.Count; n++)
         {
             FATabStripItem item    = collection[n];
             var            newItem = new FATabStripItem();
             newItem.Assign(item);
             Add(newItem);
         }
     }
     finally
     {
         EndUpdate();
     }
 }