I'm using VS 2010 and .net 4. I'm trying to figure out how to make a textbox be multiline and set the rows in codebehind. Can anyone help.
I'm trying to figure it out for a user control that i'm working on. So in 开发者_JAVA技巧the properties passed through the to user control it will set the textbox to be a multiline or not.
thanks shannon
here is how to set up a Texttbox in code behind.
TextBox TranslationTextArea = new TextBox();
TranslationTextArea.ID = "txtb" + Id;
TranslationTextArea.Text = text;
TranslationTextArea.Height = 75;
TranslationTextArea.Columns = 40;
TranslationTextArea.MaxLength = 160;
TranslationTextArea.TextMode = TextBoxMode.MultiLine;
I believe the Textmode Property and The Rows property are what you are looking for
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.textbox.aspx
精彩评论