473,698 Members | 2,313 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_Clic k(ByVal sender As Object, ByVal e As
System.EventArg s) Handles cmdSummary.Clic k

MessageBox.Show ("Here is your Order:" & countOrders & "Orders" &
FormatCurrency( stageTax) & "Total Tax" & FormatCurrency( stageOne) &
"Total Due", "R'nR - Enjoy", MessageBoxButto ns.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 64696
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******** ******@TK2MSFTN GP09.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_Clic k(ByVal sender As Object, ByVal e As
System.EventArg s) Handles cmdSummary.Clic k

MessageBox.Show ("Here is your Order:" & countOrders & "Orders" &
FormatCurrency( stageTax) & "Total Tax" & FormatCurrency( stageOne) &
"Total Due", "R'nR - Enjoy", MessageBoxButto ns.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.Ne wLine:
MessageBox.Show ("Hello" & ControlChars.Ne wLine & "World")

--
Sven Groot

http://unforgiven.bloghorn.com
Nov 20 '05 #3
Hi Sven,
The best way to go in VB.NET is ControlChars.Ne wLine:
MessageBox.Sh ow("Hello" & ControlChars.Ne wLine & "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.Ne wLine:
MessageBox.Show ("Hello" & ControlChars.Ne wLine & "World")


I prefer 'ControlChars.N ewLine' in VB.NET too, but I use 'MsgBox'
instead of 'MessageBox.Sho w'. 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.Ne wLine:
MessageBox.Show ("Hello" & ControlChars.Ne wLine & "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**********@p lanet.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.N ewLine', 'ControlChars.N ewLine',
'vbNewLine') because they do not explicitly state their value. I prefer
'ControlChars.N ewLine' 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**********@p lanet.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

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

Similar topics

1
22408
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 fine with one exception. When there is a line break in the second string that has the extract of the first string, it cannot find the words I am looking for as it stops looking when it hits the line break. For example:
5
10896
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 Given I do it so frequently I wonder if there is some builtin way to say I
1
2168
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. window.showModalDialog("page2.html", document,"menubar=no, titlebar=no, toolbar=no, location=no, directories=no, status=no, menubar=no,scrollbars=yes, resizable=no, copyhistory=yes, width=400, height=500");
5
29576
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. Thanks to Els, I have a way to do this, see below, directly from the View Source: This is a long piece of text. This is a long piece of text. This
6
16245
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", ((char)13) and ((char)10) - they don't work. When I enter a break by hand (just press enter) and run through each character in that string, the line break character has code 13 10 (yes, 2 numbers for some reason) The possible reason is that 'Enter'...
1
6915
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 the <br> tag. Thanks.
3
17332
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. Anyone know the command for this? Here's what I want to do: rst2("Change") = rst2("Change") & **LINE BREAK *** & "Autopropagated Change to..."
4
5805
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 methods with line break features, but I can't make them draw different colors within one string, And if I split the string into several part, so I can specify their colors, line breaking won't work. So, I have to break my string to lines before...
1
4623
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
4201
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 destroying html tags which wordwrap has a tendency of doing! )) What I want to do is add that line break so that it DOES force a line wrap - but I am not sure where to insert it in the function
0
8676
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8608
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9161
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8897
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8867
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6522
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4370
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2332
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.