\n to get number of lines.then if the characters per
line is over 48 then another line added.at last textbox
Rows is set according to lines -
string Comment=obj.Text;//first gets the content from database
int y = 0; int lines; int temp; int lines2;
string[] linesarray = Regex.Split(Comment, "\n");
lines = Convert.ToInt32(linesarray.Length);
lines2 = lines;
for (int app = 0; app < lines2; app++)
{
temp = linesarray[app].Length / 48;
if (temp > 0) { lines = lines + temp; }
}
if (lines > 7)
{
if (lines > 21) { setrows.Rows = 21; } else { setrows.Rows = lines; }
}
else
{ setrows.Rows = 7; } y++;
Saturday, 19 January 2013 15:54
how to make textbox height according to content
Written by Super Userif you want to resize your asp.net textbox height according
to content then these codes will help you perfectly.
Published in
asp.net