2.修改textBox屬性:
BorderStyle=None
BackColor=Control
3.選中整個Form1,對Form1的Paint事件進行編程,代碼如下:
private void Form1_Paint(object sender, PaintEventArgs e)
{
e.Graphics.DrawLine(new Pen(Color.Black, 1), this.textBox1.Location.X, this.textBox1.Location.Y + this.textBox1.Height , this.textBox1.Location.X + this.textBox1.Width, this.textBox1.Location.Y + this.textBox1.Height );
}
妳要的效果就有了。 至於背景顏色要不要,自己改BackColor就行