Exemplo n.º 1
0
        public DUINativeTabControl()
        {
            this.BackColor            = Color.FromArgb(26, 30, 31);
            dUITabControl.BorderColor = Color.White;
            dUITabControl.BorderWidth = 4;
            dUITabControl.Radius      = 15;
            DUITabPage t = new DUITabPage();

            t.Text = "1";
            t.DUIControls.Add(new DUIControl()
            {
                BackColor = Color.Red
            });
            DUITabPage t1 = new DUITabPage();

            t1.Text = "2";
            t1.DUIControls.Add(new DUIControl()
            {
                BackColor = Color.Gray
            });
            DUITabPage t2 = new DUITabPage();

            t2.Text = "3";
            t2.DUIControls.Add(new DUIControl()
            {
                BackColor = Color.Green
            });
            dUITabControl.TabPages.Add(t);
            dUITabControl.TabPages.Add(t1);
            dUITabControl.TabPages.Add(t2);
            this.DUIControls.Add(dUITabControl);
        }
Exemplo n.º 2
0
 protected virtual void ResetTabTitle()
 {
     for (int i = 0; i < this.TabPages.Count; i++)
     {
         DUITabPage item = this.TabPages[i];
         item.TitleX = this.ClientSize.Width / 2 - (this.TabPages.Count * this.TabTitleSize.Width) / 2 + i * this.TabTitleSize.Width;
         item.TitleY = 0;
     }
 }
Exemplo n.º 3
0
            public override void OnMouseDown(DUIMouseEventArgs e)
            {
                base.OnMouseDown(e);
                DUITabPage tabPage = this.owner.TabPages.OfType <DUITabPage>().FirstOrDefault(t => new RectangleF(t.TitleX, t.TitleY, this.owner.TabTitleSize.Width, this.owner.TabTitleSize.Height).Contains(e.Location));

                if (tabPage != null)
                {
                    this.owner.SelectPage(tabPage);
                }
            }
Exemplo n.º 4
0
        protected virtual void DrawTabTitle(DUITabPage tabPage, DUIPaintEventArgs e)
        {
            using (DUISolidBrush sb = new DUISolidBrush(tabPage.Selected ? Color.FromArgb(36, 107, 225) : Color.FromArgb(47, 52, 55)))
            {
                e.Graphics.FillRectangle(sb, new RectangleF(tabPage.TitleX, tabPage.TitleY, this.TabTitleSize.Width, this.TabTitleSize.Height));
            }
            SizeF sizeF = e.Graphics.MeasureString(tabPage.Text, this.Font);

            using (DUISolidBrush brush = new DUISolidBrush(Color.FromArgb(220, 224, 225)))
            {
                e.Graphics.DrawString(tabPage.Text, this.Font, brush, new PointF(tabPage.TitleX + this.TabTitleSize.Width / 2 - sizeF.Width / 2, tabPage.TitleY + this.TabTitleSize.Height / 2 - sizeF.Height / 2));
            }
        }
Exemplo n.º 5
0
 internal protected virtual void DrawTabPage(DUITabPage tabPage, DUIPaintEventArgs e)
 {
 }
Exemplo n.º 6
0
 public void SelectPage(DUITabPage tabPage)
 {
     this.selectPage = tabPage;
     this.Invalidate();
 }