Rudebox.co.nr How To Forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Rudebox.co.nr How To Forums

Rudebox How To Forums - Ask Anything, View How To's
 
HomeSearchLatest imagesRegisterLog in

 

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

Go down 
AuthorMessage
Admin
Admin
Admin


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

How to put carriage return or ' enter ' in VB .net string Empty
PostSubject: How to put carriage return or ' enter ' in VB .net string   How to put carriage return or ' enter ' in VB .net string Icon_minitimeSun Oct 28, 2007 5: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
https://rudebox.editboard.com
 
How to put carriage return or ' enter ' in VB .net string
Back to top 
Page 1 of 1
 Similar topics
-
» Avoid unexpected postback after pressing Enter in textbox
» DefaultButton , On Enter Press Raise Default Button Event

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