【问题标题】:asp.net add multiline and rows to textbox in codebehindasp.net 在代码隐藏中向文本框添加多行和行
【发布时间】:2010-12-17 18:17:59
【问题描述】:

我正在使用 VS 2010 和 .net 4。我试图弄清楚如何使文本框成为多行并在代码隐藏中设置行。谁能帮忙。

我正在尝试找出我正在处理的用户控件。因此,在通过 to 用户控件传递的属性中,它会将文本框设置为多行或不设置。

谢谢 香农

【问题讨论】:

    标签: asp.net vb.net textbox multiline


    【解决方案1】:

    这里是如何在后面的代码中设置文本框。

          TextBox TranslationTextArea = new TextBox();
          TranslationTextArea.ID = "txtb" + Id;
          TranslationTextArea.Text = text;
          TranslationTextArea.Height = 75;
          TranslationTextArea.Columns = 40;
          TranslationTextArea.MaxLength = 160;
          TranslationTextArea.TextMode = TextBoxMode.MultiLine;
    

    【讨论】:

      【解决方案2】:

      我相信 Textmode 属性和 The Rows 属性是您正在寻找的

      http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.textbox.aspx

      【讨论】:

      • 是的..但是当我查看后面代码中的文本框时它们没有出现..想知道我是不是做错了什么
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-13
      • 1970-01-01
      • 2014-05-29
      • 1970-01-01
      • 1970-01-01
      • 2011-05-16
      相关资源
      最近更新 更多