Click here to Skip to main content
15,882,063 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
Hi,
I am having an textbox with textmode as multiline and now i have to pass two strings to the textbox,
Ist string value in first line and
2nd string values in second line
I have tried as
textbox.text=string1+"<br/>"+string2;

But this is not working,Kindly let me now how to do...
Thanks in advance
Posted
Updated 4-Mar-11 1:25am
v2
Comments
Sergey Alexandrovich Kryukov 4-Mar-11 15:47pm    
You have a complete mess in your head. This is HTML! It's not about lack of knowledge, this is about not thinking. It looks like you try all you can until it works. Very, very bad.
--SA
Sergey Alexandrovich Kryukov 4-Mar-11 15:48pm    
And when you say "I found an answer" it was also incorrect. This is you problem. You think what's working at the moment is correct. I don't even thing you understand me.
--SA
sathya4260 5-Mar-11 0:04am    
kindly let me know whats wrong in my answer
Sergey Alexandrovich Kryukov 5-Mar-11 0:15am    
This is an answer. "<br/>" is HTML. How HTML is related to your text in text box, which is plain text. If's fine if anyone does not know HTML or programming. But you apparently know something, because you write a valid HTML element. The fact you suggested to put it in the text box shows that you're trying to work on a heap of information, not knowledge. Can you see the difference?

OK, I answered. You got the only correct Answer from Manas -- 16 hours ago.

--SA
sathya4260 5-Mar-11 1:08am    
Thanks,

Surely i would try to work on knowledge not on information

and i also replied one answer using "\r\n", which also worked fine,

1 solution

You can use Environment.NewLine[^] property

textbox.text = string1 + Environment.NewLine + string2;
 
Share this answer
 
Comments
#realJSOP 4-Mar-11 7:28am    
Proposed as answer
Manas Bhardwaj 4-Mar-11 7:36am    
thnx
Olivier Levrey 4-Mar-11 7:39am    
My 5.
thatraja 4-Mar-11 12:32pm    
Take a 5!
Sergey Alexandrovich Kryukov 4-Mar-11 15:49pm    
Sure, my 5.
--SA

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