制作多行文本框

Posted on 2018-12-18 21:15  努力成长静待花开  阅读(378)  评论(0编辑  收藏  举报

实现效果:

  

知识运用:
  TextBox控件的Multiline属性

  public overrider bool Multiline{ get;set;}

实现代码:

        private void button1_Click(object sender, EventArgs e)
        {
            textBox1.Location = new Point(0,0);
            textBox1.Multiline = true;
            textBox1.Width = this.Width;
            textBox1.Height = ClientRectangle.Height - button1.Height - 3;
        }