Exemplo n.º 1
0
        public SmartTabControl()
        {
            BeginInit();

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

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

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

            menuGlyph   = new FATabStripMenuGlyph(ToolStripRenderer);
            closeButton = new FATabStripCloseButton(ToolStripRenderer);
            Font        = new Font("Tahoma", 8.25f, FontStyle.Regular);
            sf          = new StringFormat();

            EndInit();

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