Re: CR & Tab in VB 2005 Textbox

Tech-Archive recommends: Fix windows errors by optimizing your registry



Lloyd

Did you now that you can just set a reference to Microsoft.VisualBasic.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.VisualBasic.dll is part of the framework


regards

Michel





"Lloyd Sheen" <a@xxx> schreef in bericht
news:7CB2854A-2E82-4149-8431-361F7796AEA6@xxxxxxxxxxxxxxxx

"Michel Posseth [MCP]" <MSDN@xxxxxxxxxxx> wrote in message
news:uhjjQSDtHHA.3732@xxxxxxxxxxxxxxxxxxxxxxx

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@xxx> schreef in bericht
news:466ED4E1-0A2E-47D8-B2F7-C9901223E1CC@xxxxxxxxxxxxxxxx

"AWW" wrote in message
news:m2gl73171hmco6o06jj092nf87gs4fpqdu@xxxxxxxxxx
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




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


.