asp.net.ph

TextBox.Wrap Property

System.Web.UI.WebControls Namespace   TextBox Class


Sets or retrieves a value indicating whether the text content wraps within a multiline text box.

Syntax


Inline <asp:textbox wrap [ = true | false ] ... >
Script TextBox.Wrap [ = true | false ]

Property Value

This property accepts or returns only a boolean value, meaning true if a control is enabled, and false if not.

This property is read/write with a default value of true.

Remarks

Use the Wrap property to specify whether the text displayed in a multiline TextBox control automatically continues on the next line when the text reaches the end of the control.

NOTE: This property is applicable only when the TextMode property is set to TextBoxMode.MultiLine.

Example

The following example demonstrates how to dynamically set the Wrap property to wrap text entered in a TextBox control.

<script language = "C#" runat = "server">

   protected void SubmitButton_Click ( Object src, EventArgs e ) {
      msg.Text = "Thank you for your comment: <br>" + comments.Text;
   }

   protected void Check_Change ( Object src, EventArgs e ) {
      comments.Wrap = wrapCheckBox.Checked;
      comments.ReadOnly = readOnlyCheckBox.Checked;
   }

</script>

 Show me 

See Also

TextBox Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph