using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace TabControlTest { public partial class Form1 : Form { public Form1() { InitializeComponent(); } const int CLOSE_SIZE = 15; Bitmap image = new Bitmap("ONE.ico"); private void MainTabControl_DrawItem(object sender, DrawItemEventArgs e) { try { Rectangle myTabRect = this.MainTabControl.GetTabRect(e.Index); //先添加TabPage属性 e.Graphics.DrawString(this.MainTabControl.TabPages[e.Index].Text , this.Font, SystemBrushes.ControlText, myTabRect.X + 2, myTabRect.Y + 2); //再画一个矩形框 using (Pen p = new Pen(Col