protected virtual void DrawTabCloser(int index, Graphics graphics) { if (this._ShowTabCloser) { Rectangle closerRect = this._TabControl.GetTabCloserRect(index); graphics.SmoothingMode = SmoothingMode.AntiAlias; using (GraphicsPath closerPath = TabStyleProvider.GetCloserPath(closerRect)) { if (closerRect.Contains(this._TabControl.MousePosition)) { using (Pen closerPen = new Pen(this._CloserColorActive)) { graphics.DrawPath(closerPen, closerPath); } } else { using (Pen closerPen = new Pen(this._CloserColor)) { graphics.DrawPath(closerPen, closerPath); } } } } }
public static TabStyleProvider CreateProvider(CustomTabControl tabControl) { TabStyleProvider provider = null; // Depending on the display style of the tabControl generate an appropriate provider. switch (tabControl.DisplayStyle) { case TabStyle.None: provider = new TabStyleNoneProvider(tabControl); break; // TODO: might not be correct. Was : Exit Select case TabStyle.Default: provider = new TabStyleDefaultProvider(tabControl); break; // TODO: might not be correct. Was : Exit Select case TabStyle.Angled: provider = new TabStyleAngledProvider(tabControl); break; // TODO: might not be correct. Was : Exit Select case TabStyle.Rounded: provider = new TabStyleRoundedProvider(tabControl); break; // TODO: might not be correct. Was : Exit Select case TabStyle.VisualStudio: provider = new TabStyleVisualStudioProvider(tabControl); break; // TODO: might not be correct. Was : Exit Select case TabStyle.Chrome: provider = new TabStyleChromeProvider(tabControl); break; // TODO: might not be correct. Was : Exit Select case TabStyle.IE8: provider = new TabStyleIE8Provider(tabControl); break; // TODO: might not be correct. Was : Exit Select case TabStyle.VS2010: provider = new TabStyleVS2010Provider(tabControl); break; // TODO: might not be correct. Was : Exit Select default: provider = new TabStyleDefaultProvider(tabControl); break; // TODO: might not be correct. Was : Exit Select } provider._Style = tabControl.DisplayStyle; return(provider); }