Home All Groups Group Topic Archive Search About

changing rows in a multiline textbox

Author
17 Oct 2006 7:44 PM
carlor
Hi there,

I have a situation where I have a textbox that by default only displays 2
rows of text at a time (textbox.rows = 2). On a link button click, I am
supposed to expand the textbox to show all the data it contains but there are
a number of problems to work through:

- the text box is in a table and textbox's width is set to 100%
- a "line" of text could contain a <CR><LF> or could wrap around to the next
line
- the font characteristics may change depending on the client's preferences

So, somehow I need to calculate how many rows are required to display all of
the text without the need for scroll bars and then set the rows property to
that number.

Does anyone have an idea how to handle this? Has anyone done this before?

Thanks,

Carlo.

Author
20 Oct 2006 12:55 PM
Jerry C
Carlor,

Look at the replys in "auto-size textbox " in this forum Posted 10/19/2006.

also look at these sites

http://www.fmsinc.com/free/NewTips/NET/NETtip45.asp

http://www.thescripts.com/forum/thread382545.html

I hope these are helpfull

Jerry
--
Jerry


Show quoteHide quote
"carlor" wrote:

> Hi there,
>
> I have a situation where I have a textbox that by default only displays 2
> rows of text at a time (textbox.rows = 2). On a link button click, I am
> supposed to expand the textbox to show all the data it contains but there are
> a number of problems to work through:
>
> - the text box is in a table and textbox's width is set to 100%
> - a "line" of text could contain a <CR><LF> or could wrap around to the next
> line
> - the font characteristics may change depending on the client's preferences
>
> So, somehow I need to calculate how many rows are required to display all of
> the text without the need for scroll bars and then set the rows property to
> that number.
>
> Does anyone have an idea how to handle this? Has anyone done this before?
>
> Thanks,
>
> Carlo.
Author
20 Oct 2006 2:18 PM
carlor
Thanks for your help Jerry!

Carlo.

Show quoteHide quote
"Jerry C" wrote:

> Carlor,
>
> Look at the replys in "auto-size textbox " in this forum Posted 10/19/2006.
>
> also look at these sites
>
> http://www.fmsinc.com/free/NewTips/NET/NETtip45.asp
>
> http://www.thescripts.com/forum/thread382545.html
>
> I hope these are helpfull
>
> Jerry
> --
> Jerry
>
>
> "carlor" wrote:
>
> > Hi there,
> >
> > I have a situation where I have a textbox that by default only displays 2
> > rows of text at a time (textbox.rows = 2). On a link button click, I am
> > supposed to expand the textbox to show all the data it contains but there are
> > a number of problems to work through:
> >
> > - the text box is in a table and textbox's width is set to 100%
> > - a "line" of text could contain a <CR><LF> or could wrap around to the next
> > line
> > - the font characteristics may change depending on the client's preferences
> >
> > So, somehow I need to calculate how many rows are required to display all of
> > the text without the need for scroll bars and then set the rows property to
> > that number.
> >
> > Does anyone have an idea how to handle this? Has anyone done this before?
> >
> > Thanks,
> >
> > Carlo.