473,383 Members | 1,737 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

How to Line Break

In the following code all I want to do is to break a line (an enter in
ms word) between each of the variables countOrders, stageTax, stageOne.
I think in vb 6.0 all you have to do is "....." &_ "this will be on a
new line"

It don't work...Plz Help

Private Sub cmdSummary_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles cmdSummary.Click

MessageBox.Show("Here is your Order:" & countOrders & "Orders" &
FormatCurrency(stageTax) & "Total Tax" & FormatCurrency(stageOne) &
"Total Due", "R'nR - Enjoy", MessageBoxButtons.OK)
End Sub
It all comes in one line and when i go &_ that returns an error

All replies welcome. Thanx
Radith
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #1
10 64636
example:

dim sOut as string
sOut = "line1" & vbcrlf & "line2"

I think you are looking for the constant vbCrLf

:)
"Radith Silva" <ra****@xtra.co.nz> wrote in message
news:e6**************@TK2MSFTNGP09.phx.gbl...
In the following code all I want to do is to break a line (an enter in
ms word) between each of the variables countOrders, stageTax, stageOne.
I think in vb 6.0 all you have to do is "....." &_ "this will be on a
new line"

It don't work...Plz Help

Private Sub cmdSummary_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles cmdSummary.Click

MessageBox.Show("Here is your Order:" & countOrders & "Orders" &
FormatCurrency(stageTax) & "Total Tax" & FormatCurrency(stageOne) &
"Total Due", "R'nR - Enjoy", MessageBoxButtons.OK)
End Sub
It all comes in one line and when i go &_ that returns an error

All replies welcome. Thanx
Radith
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 20 '05 #2
Radith Silva wrote:
In the following code all I want to do is to break a line (an enter in
ms word) between each of the variables countOrders, stageTax,
stageOne. I think in vb 6.0 all you have to do is "....." &_ "this
will be on a new line"
No, in VB6 you must use vbCrLf.
It don't work...Plz Help


The best way to go in VB.NET is ControlChars.NewLine:
MessageBox.Show("Hello" & ControlChars.NewLine & "World")

--
Sven Groot

http://unforgiven.bloghorn.com
Nov 20 '05 #3
Hi Sven,
The best way to go in VB.NET is ControlChars.NewLine:
MessageBox.Show("Hello" & ControlChars.NewLine & "World")


Can you explain why this is "The best way".

And stating with that other methods are wrong, I completly disagree this
with you because this can be *a good way*, however not always *the best way*
in my opinion.

Cor
Nov 20 '05 #4
* "Sven Groot" <sv*******@gmx.net> scripsit:
Radith Silva wrote:
In the following code all I want to do is to break a line (an enter in
ms word) between each of the variables countOrders, stageTax,
stageOne. I think in vb 6.0 all you have to do is "....." &_ "this
will be on a new line"


No, in VB6 you must use vbCrLf.


Or 'vbNewLine' which will work on the Mac too.
It don't work...Plz Help


The best way to go in VB.NET is ControlChars.NewLine:
MessageBox.Show("Hello" & ControlChars.NewLine & "World")


I prefer 'ControlChars.NewLine' in VB.NET too, but I use 'MsgBox'
instead of 'MessageBox.Show'. It's the "VB way".

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #5
Cor Ligthert wrote:
Hi Sven,
The best way to go in VB.NET is ControlChars.NewLine:
MessageBox.Show("Hello" & ControlChars.NewLine & "World")


Can you explain why this is "The best way".


Because it also works on systems where a NewLine is not CrLf.

--
Sven Groot

http://unforgiven.bloghorn.com
Nov 20 '05 #6
Hi Sven,

Have a look at this thread,

http://tinyurl.com/2lu35

I am almost not involved this thread, however that is more because my
opinion is almost the same as Armin in this.

However when you see all those ideas, I stay with my previous message that
it can be a good method, however not the *best* (where I do not give an
alternative best).

Cor
Nov 20 '05 #7
* "Cor Ligthert" <no**********@planet.nl> scripsit:
Have a look at this thread,

http://tinyurl.com/2lu35

I am almost not involved this thread, however that is more because my
opinion is almost the same as Armin in this.

However when you see all those ideas, I stay with my previous message that
it can be a good method, however not the *best* (where I do not give an
alternative best).


IMO, for a messagebox, console etc. /always/ the 'NewLine' properties
are the best ('Environment.NewLine', 'ControlChars.NewLine',
'vbNewLine') because they do not explicitly state their value. I prefer
'ControlChars.NewLine' because it's the "VB way" to get this constant
and I do not like the 'vb*' constants (they are not an enum so they are
sometimes hard to remember).

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #8
See the link to the thread I provided, there is all this discussion already
in.

And I am on the side of Armin in this.

Cor
Nov 20 '05 #9
* "Cor Ligthert" <no**********@planet.nl> scripsit:
See the link to the thread I provided, there is all this discussion already
in.

And I am on the side of Armin in this.


.... and I am on my side.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #10
LOL

And I am on the side of Armin in this.


... and I am on my side.

Nov 20 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Roland Dalmulder | last post by:
Hello all, In my PHP script I put a text file into a string. Part of that string is read, changed and removed. The while loop continuest to extract the next part of the string. This goes all...
5
by: Wai Yip Tung | last post by:
When I do for line in fp: the line string usually has a '\n' at the end. In many cases I don't want the line break character. I can trim it using if line.endswith('\n'): line = line ...
1
by: Matt | last post by:
What is the syntax for line break character in javascript?? For example, the following code will yield error " unterminated string constant." If I put the following in one line, then no error. ...
5
by: Kathryn | last post by:
Good morning! I am having a problem with a span. I have items, of which I only want to show the first X characters on the screen. If the user prints the page, I want the entire item to print....
6
by: Nurchi BECHED | last post by:
Hello, All! I have created an application with a multiline textbox on the form. When I press a button, it has to show something and then break the line and show something else. I tried "\n",...
1
by: questionz_99 | last post by:
How would I specify line breaks of specific height? For example, if I wanted to insert a 6-point line break, what would the CSS code look like? Obviously, I'd like something more specific than...
3
by: lmawler | last post by:
Hi all, I know when I do data entry, I can force a line break in a text box by using Control & Enter. I'm trying to insert a line break in a field (that behaves like Control Enter) from VB. ...
4
by: deerchao | last post by:
Hi, I'd like to render colorful text with word wrap on screen (kind of inline <fonttag to change text color in html), but run into the line break problem. Graphics provides several DrawString...
1
by: mccalla | last post by:
Hi all, Tricky question. I know how to remove line break characters and spaces by using the code below: $message =~ s/\n//g; $message =~ s/\s//g;
7
by: jeddiki | last post by:
Hi, I am using a function called htmlwrap() which states that it does NOT add a "<br>" to the 70 character line so that it forces a line wrap. ( the script safely wraps long words without...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.