public override void RenderHeader(Graphics g, TabListPage page, TabListPageState state) { Color fillColor; Color textColor; Rectangle fillBounds; Rectangle textRectangle; TextFormatFlags flags; fillBounds = new Rectangle(page.HeaderBounds.Left + 10, page.HeaderBounds.Top, page.HeaderBounds.Width - 10, page.HeaderBounds.Height); textRectangle = Rectangle.Inflate(fillBounds, -4, -4); // define the most appropriate colors fillColor = page.Owner.BackColor; textColor = page.Owner.ForeColor; // fill the background using (Brush brush = new SolidBrush(fillColor)) g.FillRectangle(brush, fillBounds); // draw a chevron if ((state & TabListPageState.Selected) == TabListPageState.Selected) { using (Font font = new Font(page.Font.FontFamily, page.Font.Size + 2, FontStyle.Bold)) TextRenderer.DrawText(g, "»", font, page.HeaderBounds.Location, page.ForeColor); } // draw the text flags = TextFormatFlags.VerticalCenter | TextFormatFlags.Left | TextFormatFlags.NoPrefix | TextFormatFlags.SingleLine | TextFormatFlags.WordEllipsis; using (Font font = new Font(page.Font, (state & TabListPageState.Selected) == TabListPageState.Selected ? FontStyle.Bold : FontStyle.Regular)) TextRenderer.DrawText(g, page.Text, font, textRectangle, textColor, fillColor, flags); }
private TabListPage CreateDemoTabPage3() { TabListPage page; page = new TabListPage { Text = "Advanced" }; return(page); }
private TabListPage CreateDemoTabPage2() { TabListPage page; page = new TabListPage { Text = "Options 2" }; return(page); }
private void AddPage <T>(TabListPage host) where T : UserControl, new() { T control; control = new T() { Dock = DockStyle.Fill }; if (control is SettingsPanelBase settingsPanel) { settingsPanel.LoadSettings(_settings); } host.Controls.Add(control); }