CR& VB 2005文本框中的选项卡 [英] CR & Tab in VB 2005 Textbox

查看:77
本文介绍了CR& VB 2005文本框中的选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Textbox.Text =" 123" &安培; CStr(13)& 456

我希望屏幕上有2行但是得到1行,其中有13行。

它在RichTextBox中工作过一次然后停止了。

我只想在屏幕上显示对齐的表格数据,使用CR&

Tabs来创建数据列。

我是一个老程序员但.Net新手。< g>

帮助。

解决方案



" AWW"在留言新闻中写道:m2 ******************************** @ 4ax.com ...
< blockquote class =post_quotes>
使用Textbox.Text =" 123" &安培; CStr(13)& 456

我希望屏幕上有2行但是得到1行,其中有13行。

它在RichTextBox中工作过一次然后停止了。

我只想在屏幕上显示对齐的表格数据,使用CR&

Tabs来创建数据列。

我是一个老程序员但.Net新手。< g>

帮助。



您可能希望在System.Environment下使用以下常量


首先是System.Environment.NewLine。这将确保你有换行符的

正确设置(无论它在哪里运行)。


还有一个VBCRLF常量可以是使用但不是真的Dot.Net


其次(如果你使用上面的话就消失了)CStr正在转换为你看到

到一个字符串值。我只能建议你不要使用任何旧的VB函数和直接使用Dot.Net。从长远来看,这个

将使事情变得更容易和更加一致。


Lloyd Sheen



首先确保文本框的多行属性设置为true


并且您可能会更容易使用方便的VB常量


VbCr(cariage return)

VbCrlf(cariage返回换行)

VbTab(标签)

问候


米歇尔


< AWWschreef在bericht新闻:m2 **************** **************** @ 4ax.com ...


使用Textbox.Text =" 123" &安培; CStr(13)& 456

我希望屏幕上有2行但是得到1行,其中有13行。

它在RichTextBox中工作过一次然后停止了。

我只想在屏幕上显示对齐的表格数据,使用CR&

Tabs来创建数据列。

我是一个老程序员但.Net新手。< g>

帮助。



AWW写道:


使用Textbox.Text =" 123" ; &安培; CStr(13)& 456

我希望屏幕上有2行但是得到1行,其中有13行。



我认为你正在寻找的功能是Chr(),而不是CStr()。


但是无论如何你最好还是使用vbCrLf:


\\\

Textbox.Text =" 123" &安培; vbCrLf& 456

///


-


(O)enone


Using Textbox.Text = "123" & CStr(13) & "456"
I expect 2 lines on the screen but get 1 line with 13 in it.
It worked once in a RichTextBox but then stopped.
I just want to display aligned tabular data on the screen using CR &
Tabs to create data columns.
I am an old programmer but .Net novice.<g>
Help.

解决方案


"AWW" wrote in message news:m2********************************@4ax.com...

Using Textbox.Text = "123" & CStr(13) & "456"
I expect 2 lines on the screen but get 1 line with 13 in it.
It worked once in a RichTextBox but then stopped.
I just want to display aligned tabular data on the screen using CR &
Tabs to create data columns.
I am an old programmer but .Net novice.<g>
Help.

You may want to use the following constant under System.Environment

first is System.Environment.NewLine. This will ensure that you have the
correct setting for the newline character (no matter where it runs).

There is also a VBCRLF constant which can be used but is not really Dot.Net

Secondly (and gone if you use the above) the CStr is converting as you saw
to a string with that value. I can only suggest that you don''t use any of
the old VB functions and go with straight Dot.Net. In the long run this
will make things easier and more consistant.

Lloyd Sheen



First make sure the textbox`s multiline property is set to true

and maybe you would findit easier to use the handy VB contstants

VbCr ( cariage return )
VbCrlf ( cariage return linefeed )
VbTab ( tab )
regards

Michel

<AWWschreef in bericht news:m2********************************@4ax.com...

Using Textbox.Text = "123" & CStr(13) & "456"
I expect 2 lines on the screen but get 1 line with 13 in it.
It worked once in a RichTextBox but then stopped.
I just want to display aligned tabular data on the screen using CR &
Tabs to create data columns.
I am an old programmer but .Net novice.<g>
Help.



AWW wrote:

Using Textbox.Text = "123" & CStr(13) & "456"
I expect 2 lines on the screen but get 1 line with 13 in it.

I think the function you''re looking for is Chr(), not CStr().

But anyway, you''re much better off using vbCrLf instead:

\\\
Textbox.Text = "123" & vbCrLf & "456"
///

--

(O)enone


这篇关于CR&amp; VB 2005文本框中的选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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