Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a input textbox. i want to show a msg like "rahul is the student of class b.tech".
my textbox is print "rahul is" and to read full msg i am using arrow key. but i want that when msg is larger then input box width it move to next line.. how can i do it.. if input textbox is not suitable for that work. what can i use for it.
Posted
Comments
Murugesan22 17-Apr-14 4:22am    
my suggestion is use textarea

Well I think that using an input field you can't get this behavior. At least I've never seen that before. That's why TextArea exists for.

<textarea rows="10" cols="30"></textarea>

:)
 
Share this answer
 
Comments
TCS54321 17-Apr-14 8:01am    
but in text area how can i take value using vb.net that i can use in input textbox.
Automatic line break in asp.net textbox control[^]
Quote:

You need to set the columns property of the textbox to the maximum width you want.


There is also a width property that will also set the width to a specific pixel size.


In either case, you need to specify that the text in the textbox should wrap by setting the wrap property to true.


ASP.NET
<asp:TextBox ID="txt" columns="20" wrap="true" runat="server" />

Otherwise you can also set property TextMode="Multiline" for the TextBox.
 
Share this answer
 
Comments
TCS54321 17-Apr-14 4:52am    
i am using inputbox. how can i do it in inputbox. or if i will use textbox how can i take value field in textbox.
Which inputbox? Can you show me the code?
TCS54321 17-Apr-14 6:01am    
strb.Append("<input id=""Text1"" style="" width=""50px"" text-align: center;"" class=""txt"" type=""text"" name='value_""1""_txb' value=""class:" & k & """/>")

i am using this in vb.net
Sorry, I am late. You have got the answer already to use TextArea. That's good. :)
TCS54321 18-Apr-14 1:13am    
tnx
Hi,
you can use textarea instead of textbox.
C#
strb.Append("<textarea rows="4" cols="50" id="" text1="" style="" width="" 50px="" class="" txt="" type="" text="" name="value_""1""_txb" value="" />")


Please mark as answer if you find useful.
 
Share this answer
 
Comments
TCS54321 17-Apr-14 8:06am    
its not working
Hi,
you can assign text like following code.
C#
strb.Append("<textarea rows="10" cols="50">"+value+")
 
Share this answer
 
Comments
TCS54321 17-Apr-14 8:19am    
its working.. thanku

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900