Rudebox.co.nr How To Forums

Rudebox How To Forums - Ask Anything, View How To's
 
HomeFAQSearchRegisterMemberlistUsergroupsLog in
Share | 
 

 How to put carriage return or ' enter ' in VB .net string

View previous topic View next topic Go down 
AuthorMessage
Admin
Admin


Number of posts: 216
Registration date: 2007-01-01

PostSubject: How to put carriage return or ' enter ' in VB .net string   Sun Oct 28, 2007 11:17 am

vbCrLf

example

Dim print String = "I Love" + vbCrLf + "Rudebox"

and u print it

it will give

I Love
Rudebox

Another thing you can do is : FOR ASP .net

1) Put a Placeholder (from the toolbox) on the aspx page (id=placeHolder)
2) In the code behind, create a Label

Dim newLabel as Label = new Label
newLabel.Text = "1st Line"

placeHolder.Controls.Add(newLabel)

Dim newLiteral as Literal = new Literal
newLiteral.Text = "<br>"

placeHolder.Controls.Add(newLiteral)

newLabel = new Label
newLabe.Text = "2nd Line"
placeHolder.Controls.Add(newLabel)

newLiteral = new Literal
newLiteral.Text = "<br>"
placeHolder.Controls.Add(newLiteral)

placeHolder.Visible= true

Result:
1st Line
2nd Line
Back to top Go down
View user profile http://rudebox.editboard.com
 

How to put carriage return or ' enter ' in VB .net string

View previous topic View next topic Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Rudebox.co.nr How To Forums :: -