Esempio n. 1
0
        public TabControl()
        {
            MenuOpen = false;
            this.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);

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

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

            this.menuGlyph             = new TabControlMenuGlyph(this.ToolStripRenderer);
            this.closeButton           = new TabControlCloseButton(this.ToolStripRenderer);
            this.Font                  = new Font("Tahoma", 8.25f, FontStyle.Regular);
            this.sf                    = new StringFormat();
            this.movePreview           = new TabPreview(this);
            this.movePreview.AllowDrop = true;

            this.EndInit();

            this.UpdateLayout();
        }
Esempio n. 2
0
        public TabControl()
        {
            MenuOpen = false;
            this.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);

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

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

            this.menuGlyph = new TabControlMenuGlyph(this.ToolStripRenderer);
            this.closeButton = new TabControlCloseButton(this.ToolStripRenderer);
            this.Font = new Font("Tahoma", 8.25f, FontStyle.Regular);
            this.sf = new StringFormat();
            this.movePreview = new TabPreview(this);

            this.EndInit();

            this.UpdateLayout();
        }