日期:2014-05-18 浏览次数:21176 次
    class MyTextBox:TextBox
    {
        protected override void WndProc(ref System.Windows.Forms.Message m)
        {
            base.WndProc(ref m);
            const int WM_PAINT = 0xF;
            if (m.Msg == WM_PAINT)
            {
                Graphics g = Graphics.FromHwnd(this.Handle);
                g.DrawLine(new Pen(Brushes.Black), this.ClientRectangle.Left, this.ClientRectangle.Bottom - 2, this.ClientRectangle.Right, this.ClientRectangle.Bottom - 2);
                g.Dispose();
            }
        }
    }