private void DrawTab(int i, Graphics gr, bool selected, bool mouseover) { if (TabStyle == null) { throw new ArgumentNullException("Custom style not attached"); } Color tabc1 = (Enabled) ? ((selected) ? TabSelectedColor : ((mouseover) ? TabMouseOverColor : TabNotSelectedColor)) : TabNotSelectedColor.Multiply(TabDisabledScaling); Color tabc2 = (FlatStyle == FlatStyle.Popup) ? tabc1.Multiply(TabColorScaling) : tabc1; Color taboutline = (selected) ? TabControlBorderColor : TabNotSelectedBorderColor; Image tabimage = null; TabStyle.DrawTab(gr, GetTabRect(i), i, selected, tabc1, tabc2, taboutline, Alignment); if (this.ImageList != null && this.TabPages[i].ImageIndex >= 0 && this.TabPages[i].ImageIndex < this.ImageList.Images.Count) { tabimage = this.ImageList.Images[this.TabPages[i].ImageIndex]; } Color tabtextc = (Enabled) ? ((selected) ? TextSelectedColor : TextNotSelectedColor) : TextNotSelectedColor.Multiply(TabDisabledScaling); TabStyle.DrawText(gr, GetTabRect(i), i, selected, tabtextc, this.TabPages[i].Text, Font, tabimage); gr.SmoothingMode = SmoothingMode.Default; }
private void DrawTab(Graphics gr, Rectangle area, string text, Image img, bool selected, bool mouseover) { if (TabStyle == null) { throw new ArgumentNullException("Custom style not attached"); } Color tabc1 = (Enabled) ? (mouseover ? TabMouseOverColor : (selected ? TabSelectedColor : TabNotSelectedColor)) : TabNotSelectedColor.Multiply(BackDisabledScaling); Color tabc2 = tabc1.Multiply(TabColorScaling); Color taboutline = TabControlBorderColor; TabStyle.DrawTab(gr, area, selected, tabc1, tabc2, taboutline, TabStyleCustom.TabAlignment.Top); Color tabtextc = (Enabled) ? ((selected) ? ForeColor : TextNotSelectedColor) : TextNotSelectedColor.Multiply(ForeDisabledScaling); TabStyle.DrawText(gr, area, selected, tabtextc, text, Font, img); }