实现的功能:重写TabControl控件。要先在项目中加入图片close,新建的选项卡就带上了关闭的图标。
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Drawing;
namespace MengYe.writeclass
{
/// <summary>
/// 重写的TabControl控件
/// </summary>
public class SimpleTabControl : TabControl
{
private int iconWidth = 15;
private int iconHeight = 13;
private Image icon = null;
private Brush biaocolor = Brushes.White; //选项卡的背景色
public SimpleTabControl(): base()
{
this.