如何换行 [英] How to Line Break

查看:77
本文介绍了如何换行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在下面的代码中,我想要做的就是在每个变量countOrders,stageTax,stageOne之间打破一行(输入

ms字)。

我认为在vb 6.0中你所要做的就是..... & _"这将是

新行


它不起作用...... Plz帮助


Private Sub cmdSummary_Click(ByVal sender As Object,ByVal e As

System.EventArgs)处理cmdSummary.Click


MessageBox.Show( 这是您的订单:& countOrders&" Orders"&

FormatCurrency(stageTax)&Total Tax& FormatCurrency(stageOne)&

Total Due,R''nR - Enjoy,MessageBoxButtons.OK)

End Sub

这一切都有一行,当我去& _返回错误


欢迎所有回复。 Thanx

Radith

***通过开发人员指南发送http://www.developersdex.com ***

不要只是参加USENET ......获得奖励!

解决方案

例子:


dim sOut as string

sOut =" line1" &安培; vbcrlf& line2


我认为你正在寻找常数vbCrLf


:)

" Radith Silva的" < RA **** @ xtra.co.nz>在留言中写道

新闻:e6 ************** @ TK2MSFTNGP09.phx.gbl ...

在以下代码中全部我想要做的是在每个变量countOrders,stageTax,stageOne之间打破一行(输入
ms字)。
我认为在vb 6.0中你所要做的就是.. ..." & _"这将是一个
新行

它不起作用... Plz帮助

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

MessageBox.Show(这是你的订单:& countOrders&" Orders&
FormatCurrency(stageTax)&Total Tax& FormatCurrency(stageOne)&
" Total Due"," R''nR-Enjoy",MessageBoxButtons.OK)结束子

这一切都在一行中,当我去& _返回错误

欢迎所有回复。 Thanx
Radith

***通过开发人员指南 http:// www.developersdex.com ***
不要只是参加USENET ......获得奖励!



Radith Silva写道:

在下面的代码中,我想要做的就是在每个变量countOrders,stageTax, ms字) > stageOne。我认为在vb 6.0中你所要做的只是..... & _"这个
将在新的一行


不,在VB6中你必须使用vbCrLf。

它不起作用... Plz帮助




进入VB.NET的最佳方式是ControlChars.NewLine:

MessageBox.Show(" Hello"& ControlChars.NewLine&" World")


-

Sven Groot

http://unforgiven.bloghorn.com


嗨Sven,

< blockquote class =post_quotes> VB.NET的最佳方式是ControlChars.NewLine:
MessageBox.Show(" Hello"& ControlChars.NewLine&" World")




你能解释为什么这是最好的方式。


说明其他方法是错误的,我完全不同意这个

,因为这可能是一个很好的方式*,但并不总是*最好的方式*

在我看来。 />

Cor


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!

解决方案

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!



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


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


这篇关于如何换行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆