on 2005 Jun 28 1:50 PM
Hi all
How can I start a new line in a textview?
I tried the following, but it doesn't work:
me.textview1.text = "firstline" & vbCrLf & "secondline"
Many thanks!
Liesbeth
Hi,
So the bad news are that since what you write in the text property of the TextView will be rendered to html the vbCrLf will not work, since it has no meaning in html. In fact, you couldn't use "<br>" either, since it will be encoded (to ensure you don't ever "break" it's rendering).
The good news are that TextView supports Wrapping and a special layout... (Layout="PARAGRAPH" Wrapping="True"). This of course will not ensure you get a new line exactly where you want it, but will still give you "new lines" where needed.
For having "new lines" exactly where you want them you will probably have to use several TextViews, separated by "<BR>".
If you want to do this in dynamically, in code, I've come up with a relatively simple solution for you:
Put a Panel or PlaceHolder (regular ASP) control where you want to have the text View. In your code do this:
Panel1.Controls.Clear();
Panel1.Controls.Add(new TextView("Line 1"));
Panel1.Controls.Add(new LiteralControl("<br>"));
Panel1.Controls.Add(new TextView("Line 2"));
Panel1.Controls.Add(new LiteralControl("<br>"));
Panel1.Controls.Add(new TextView("Line 3"));
Might not be the best solution, but it will at least have the effect you wanted
Regards,
Ofer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you filled the PDK for .NET survey yet? You can win an MP3 player!!!
http://feedback.sap.com/efs/vote?campaign=39c7899ecca40a6709a638bd0388ac8b&org=332
User | Count |
---|---|
62 | |
12 | |
7 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.