C#.net在tabcontrol和特定的tabpage上绘制

时间:2017-06-27 17:40:02

标签: c# winforms graphics draw tabcontrol

最近我尝试在win上绘制一个矩形,这是代码

namespace GDI1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

            //i want do the below lines for specific tab page :)

            this.DoubleBuffered = true;
            this.Paint += new PaintEventHandler(Form1_Paint);
        }

        private void Form1_Paint(object sender , System.Windows.Forms.PaintEventArgs e)
        {
            e.Graphics.FillRectangle(Brushes.Green, new Rectangle(50, 50, 530, 40));

        }
    }
}

现在我想做同样的事情,但在特定的标签页面上....我如何设置tabcontrol的代码。

what i tried what i want

0 个答案:

没有答案