By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,948 Members | 663 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,948 IT Pros & Developers. It's quick & easy.

new line char

P: 10
this is my text. how do i insert a new line char in vb6.0

label1.Text = "There was a problem with your payment. Please check your credit card information and try again. Make sure the credit card number is entered correctly (no spaces, hyphens or other punctuation). * The CVV2 code must be current and correctly entered. * The expiration date must be current and correctly entered. If you still are unable to submit the payment with the credit card you are using, contact your credit card provider for direct service to verify that the information on your card is current."
Jul 14 '08 #1
Share this Question
Share on Google+
7 Replies


jeffstl
Expert 100+
P: 432
Need to use the carriage return within your string to start a new line

Expand|Select|Wrap|Line Numbers
  1. label1.Text = "This is the First line " & vbCrLf & " and this is the second line"
  2.  
Jul 14 '08 #2

P: 10
tried it. but it is not working in the .net environment. also tried environment.newline and vbnewline
Jul 14 '08 #3

jeffstl
Expert 100+
P: 432
tried it. but it is not working in the .net environment. also tried environment.newline and vbnewline
OK. Well that is interesting because you specifically asked "this is my text. how do i insert a new line char in vb6.0"

Yes the .NET environment will be different and another thing that will be different is what you are writing out to.

Is this DHTML output? Is it output to a client interface?

If it is DHTML output on say a webpage, then you can use either dynamic <tr> or a <br> tag to start a new line.
Jul 14 '08 #4

P: 10
it is the o/p to a client interface. the actual project i am working on is in vb6.0 but trying it out on the .net environment. sorry if i led u astray.
Jul 14 '08 #5

jeffstl
Expert 100+
P: 432
it is the o/p to a client interface. the actual project i am working on is in vb6.0 but trying it out on the .net environment. sorry if i led u astray.
Oh ok. Well actually the vbCrLf should technically still work even in a .NET environment.

If that doesnt though you are on the right track with .NewLine, etc.

Though you mentioned it doesnt work, so I guess I'd be curious to know what that means exactly. Did you get an error? Is the output unchanged? What about it isn't working?
Jul 14 '08 #6

P: 10
Oh ok. Well actually the vbCrLf should technically still work even in a .NET environment.

If that doesnt though you are on the right track with .NewLine, etc.

Though you mentioned it doesnt work, so I guess I'd be curious to know what that means exactly. Did you get an error? Is the output unchanged? What about it isn't working?

I do not get a compilation error. but wen i do get the o/p it is
"this is the first line and this is the second line. "
does not put it to the next line.
Jul 14 '08 #7

jeffstl
Expert 100+
P: 432
Sorry it took me a bit

I think this page has the info you want

VB.NET carriage return
Jul 16 '08 #8

Post your reply

Sign in to post your reply or Sign up for a free account.