473,545 Members | 2,113 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CR & Tab in VB 2005 Textbox

AWW
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.
Jun 21 '07 #1
17 4717

"AWW" wrote in message news:m2******** *************** *********@4ax.c om...
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.Environm ent

first is System.Environm ent.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

Jun 21 '07 #2

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.c om...
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.

Jun 21 '07 #3
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
Jun 21 '07 #4
<AWWschrieb
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.

I guess you know that you wanted to write Chr(13) instead of CStr(13). :-)

Or use vbCr instead.
Armin
Jun 21 '07 #5
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
Huh ???
Well read this

http://www.codeproject.com/useritems/novbruntimeref.asp

and read my responses

There is nothing old or outdated or whatever in the Microsoft Visual Basic
..NET Runtime

Just my thoughts regarding this mather

regards

Michel Posseth

"Lloyd Sheen" <a@b.cschreef in bericht
news:46******** *************** ***********@mic rosoft.com...
>
"AWW" wrote in message news:m2******** *************** *********@4ax.c om...
>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.Environm ent

first is System.Environm ent.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

Jun 21 '07 #6

"Michel Posseth [MCP]" <MS**@posseth.c omwrote in message
news:uh******** ******@TK2MSFTN GP02.phx.gbl...
>
>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

Huh ???
Well read this

http://www.codeproject.com/useritems/novbruntimeref.asp

and read my responses

There is nothing old or outdated or whatever in the Microsoft Visual Basic
.NET Runtime

Just my thoughts regarding this mather

regards

Michel Posseth

"Lloyd Sheen" <a@b.cschreef in bericht
news:46******** *************** ***********@mic rosoft.com...
>>
"AWW" wrote in message news:m2******** *************** *********@4ax.c om...
>>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.Environm ent

first is System.Environm ent.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

Sorry what I meant was to keep the code Dot.Net you would use the functions
that are provide for each object. I do this since I use both VB and C# and
sometimes I need to use code (not enough for a seperate assembly) and if I
use the Dot.Net functions provided by the objects rather than the VB it is
easier to convert since it is mostly getting rid of ending semi colons and
changing square brackets into regular brackets (and the other stuff of
course).

I just find that this way (even though VB will not disappear , and I bought
a copy of VB1 in Long Beach the day it was first available so I have been
using VB for quite some time (I guess that was 91)).

Just my 2 cents

Lloyd Sheen

Jun 21 '07 #7
AWW
Yes, multiline is True in both RichTextBox & TextBox and
both VbCr/VBTab work in RichTextBox but only VbTab in TextBox.
I can rewrite the whole box but would like to rewrite individual lines
and cannot find any way to set a position for the rewrite.
Thanks - so far.

On Thu, 21 Jun 2007 20:38:04 +0200, "Michel Posseth [MCP]"
<MS**@posseth.c omwrote:
>
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.c om...
>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.
Jun 21 '07 #8
Lloyd Sheen wrote:
Sorry what I meant was to keep the code Dot.Net you would use the
functions that are provide for each object. I do this since I use
both VB and C# and sometimes I need to use code (not enough for a
seperate assembly) and if I use the Dot.Net functions provided by the
objects rather than the VB it is easier to convert since it is mostly
getting rid of ending semi colons and changing square brackets into
regular brackets (and the other stuff of course).
There's nothing stopping you referencing Microsoft.Visua lBasic.dll and using
the functions within it from C#, you know! :)

--

(O)enone
Jun 21 '07 #9
Lloyd

Did you now that you can just set a reference to Microsoft.Visua lBasic.dll
in a C# project and then use all the handy shortcuts in C# as well

And no you then not have a extra dependancy as we code on the framework and
the Microsoft.Visua lBasic.dll is part of the framework
regards

Michel

"Lloyd Sheen" <a@b.cschreef in bericht
news:7C******** *************** ***********@mic rosoft.com...
>
"Michel Posseth [MCP]" <MS**@posseth.c omwrote in message
news:uh******** ******@TK2MSFTN GP02.phx.gbl...
>>
>>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

Huh ???
Well read this

http://www.codeproject.com/useritems/novbruntimeref.asp

and read my responses

There is nothing old or outdated or whatever in the Microsoft Visual
Basic .NET Runtime

Just my thoughts regarding this mather

regards

Michel Posseth

"Lloyd Sheen" <a@b.cschreef in bericht
news:46******* *************** ************@mi crosoft.com...
>>>
"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.Environm ent

first is System.Environm ent.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


Sorry what I meant was to keep the code Dot.Net you would use the
functions that are provide for each object. I do this since I use both VB
and C# and sometimes I need to use code (not enough for a seperate
assembly) and if I use the Dot.Net functions provided by the objects
rather than the VB it is easier to convert since it is mostly getting rid
of ending semi colons and changing square brackets into regular brackets
(and the other stuff of course).

I just find that this way (even though VB will not disappear , and I
bought a copy of VB1 in Long Beach the day it was first available so I
have been using VB for quite some time (I guess that was 91)).

Just my 2 cents

Lloyd Sheen

Jun 22 '07 #10

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

Similar topics

2
1515
by: Michael | last post by:
Hi, Can someone tell me if I could use Visual Studio 2005 (RTM) alongside Visual Studio .NET 2003? Also, can VS 2005 generate output targeting 1.1? I have code written for .NET 1.1 and therefore need to either A, have VS 2005 target 1.1 as well as 2.0, or B, keep 2003 for 1.1 and use 2005 for newer applications using .NET 2.0. Thank...
3
1334
by: | last post by:
is there any performance diffrence between MC++ 2003 ,other .NET languages and MC++ 2005 (cause of an optimization) ???
2
1086
by: Al | last post by:
I'd installed VC++ Express 2005 beta 2 but I couldn't create new projects from templates or when I opened an existing solution, I couldn' build it: 'exe not found!' The same happened whith VC++.NET 2003 (a friend's). Is it a framework problem? (I've got the 1.1)
4
989
by: VB Programmer | last post by:
Just wondering... Have you had any issues using both vs.net 2003 and 2005 beta on your machine? (including the 2 frameworks) Or, do they work pretty autonomously? Any suggestions? Thanks.
0
435
by: rmk | last post by:
How can I get the 2000 and 2005 versions of SQL Server Reporting Services both working on my development laptop ????? I have ASP.NET 1.1 and 2.0 installed on my laptop. I have Visual Studio 2003 and 2005 installed on my laptop. I have my default website configured for ASP.NET 2.0. I have the developer edition of SQL Server 2000...
2
4600
by: steve1rm | last post by:
Hello, I have a version of 2000 already installed which I still need. However, I recently installed 2005, something did not install right, so I was forced to de-install it. However, when I go to sql configuration manager, my named instances in 2005 are still there. Is there anyway to do a complete de-install of 2005? Maybe a step by step on...
1
1903
by: MartyL | last post by:
I created some textboxes in VB 2005 with borderstyle property set to "Fixed3D" and the textboxes appear on the form as 2D with a thin black line boder ala VB 3.0. I don't see any service packs for Visual Basic 2005 or Visual Studio 2005, so what gives? I find it hard to believe that code created with VB 2005 should look "flat" like the ols VB...
1
1608
xarzu
by: xarzu | last post by:
Has anyone else seen that the msdn examples do not compile in VC 2005? There seems to be a Skipped Rebuild All message that comes up when I compile.
0
7468
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...
0
7656
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. ...
0
7757
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...
0
5972
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3450
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...
0
3443
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1884
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1014
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
704
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.