private void InitializeComponent() { // // mmTabControl // this.SelectedIndexChanged += new System.EventHandler(this.mmTabControl_SelectedIndexChanged); // ***NEW*** allow control elements to be drawn manually this.DrawMode = TabDrawMode.OwnerDrawFixed; }And this code:
/// <summary> /// Processes hotkey, if any /// </summary> /// <param name="charCode">hotkey pressed</param> /// <returns>true</returns> protected override bool ProcessMnemonic(char charCode) { for (int i = 0; i < this.TabPages.Count; i++) { if (Control.IsMnemonic(charCode, TabPages[i].Text)) { this.SelectedTab = TabPages[i]; this.Focus(); break; } } return true; } /// <summary> /// Raises the System.Windows.Forms.TabControl.DrawItem event /// </summary> /// <param name="e">DrawItemEventArgs</param> protected override void OnDrawItem(DrawItemEventArgs e) { base.OnDrawItem(e); Graphics graphics = e.Graphics; StringFormat stringFormat = new StringFormat(); stringFormat.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.Show; stringFormat.LineAlignment = StringAlignment.Center; stringFormat.Alignment = StringAlignment.Center; graphics.DrawString( this.TabPages[e.Index].Text, this.Font, SystemBrushes.WindowText, this.GetTabRect(e.Index), stringFormat); }Thanks!