As mentioned already, after you have added a text box and change it into a memo, it assumes some default dimensions about the height and the width. We know that you can control the width of a text box by assigning a value to the Columns attribute. To assist you with the height of a memo, you measure it in terms of the height of a character. This characteristic is controlled by the Rows attribute, which represents the number of visible lines of the memo. To specify the number of lines of text that the memo can show at one time, assign a value to the Rows attribute. Here is an example: <%@ Page Language="C#" %>
<html>
<head>
<title>Exercise</title>
</head>
<body>
<form id="frmTimeSheet" runat="server">
<asp:TextBox ID="txtNotes"
TextMode="Multiline"
Columns="25"
Rows="4"
Text="I worked 14.50 hours on Tuesday but, to avoid
overtime, I was asked to sign 8 hours on
Tuesday and 6 hours on Friday."
runat="server"></asp:TextBox>
</form>
</body>
</html>
This would produce:
When text is added to a memo, the operating system calculates the length of the text. If the text is too long with regards to the width of the control, a vertical scroll bar is added to it so the line can be interrupted and continue on the next. Wrapping is a characteristic of a memo that consists of continuing the text even if it is longer that the memo can show. To control this characteristic, the <asp:TextBox> tag is equipped with a Boolean attribute named Wrap. The default value of the Wrap attribute is True. If you to change it, set its value accordingly. Here is an example: <%@ Page Language="C#" %>
<html>
<head>
<title>Exercise</title>
</head>
<body>
<form id="frmTimeSheet" runat="server">
<asp:TextBox ID="txtNotes"
TextMode="Multiline"
Columns="25"
Rows="4"
Wrap="False"
Text="I worked 14.50 hours on Tuesday but, to avoid
overtime, I was asked to sign 8 hours on
Tuesday and 6 hours on Friday."
runat="server"></asp:TextBox>
</form>
</body>
</html>
This would produce:
|
|
|||||
|
|