|
-
Jul 30th, 2002, 10:32 PM
#1
Thread Starter
Junior Member
vbCrLf in a string
I have a program that I'm troubleshooting, and I have a bunch of strings that are as follows:
bungcords = vbCrLf & "__ bungcords"
Also, I have a few parts like this:
If CheckBox1.Checked = True Then
Input1 = vbCrLf & "__ " & txtInput1.Text
End If
Is that the proper syntax to be using? I'm not sure with this debugging stuff, because the program will run on my computer, but not on any others (with the Framework installed, of course). Thanks.
-
Aug 1st, 2002, 08:28 AM
#2
New Member
I can't see any problem in your code !!
But be aware that the new line comes before the text. If the control u are using have space for only one line, you will not see the text.
-
Aug 1st, 2002, 09:03 AM
#3
try adding \n as that is used for line breaks now in .NET
"Hello\n Chris"
should look like this in a texbox
Hello
Chris
-
Aug 1st, 2002, 01:18 PM
#4
yay gay
no its not used in .NET ...its just in c++ and c# not in vb
-
Aug 1st, 2002, 04:09 PM
#5
Thread Starter
Junior Member
Thanks for the responses! I'm working on the project right now. WHEN I get it working (I will if it's the last thing I do) I'll post back. Same thing goes if I have any more questions develop.
EDIT**
I can't seem to get the \n to work properly. For a buttons click event:
TextBox1.Text = "This is some\n Text"
It Prints it exactly like that. Am I using that correct way, or am I missing something? With a couple quick glances at the Help, I'm still clueless (as usual for me with MS help...).
Last edited by Dodgeram01; Aug 1st, 2002 at 05:04 PM.
-
Aug 1st, 2002, 08:07 PM
#6
New Member
/n is not vb
As PT Exorcist said, /n is not vb code. It only works with C++ and C#.
-
Aug 1st, 2002, 08:38 PM
#7
Thread Starter
Junior Member
I see. I thought he was referencing the vbCrLf part. But that explains it then.
-
Aug 2nd, 2002, 08:25 AM
#8
sorry I use both C# an VB so I get confused from time to time.
LOL
-
Aug 2nd, 2002, 01:22 PM
#9
yay gay
yes i at start thought we could use \n too but tested and it seemed not to work lol
-
Aug 2nd, 2002, 01:42 PM
#10
Did you try:
ControlChars.NewLine
Or ControlChars.CrLf
-
Aug 2nd, 2002, 09:38 PM
#11
Hyperactive Member
Re: vbCrLf in a string
Originally posted by Dodgeram01
Is that the proper syntax to be using? I'm not sure with this debugging stuff, because the program will run on my computer, but not on any others (with the Framework installed, of course). Thanks.
That code should work no problem. Are you sure that your errors aren't caused by something else?
-
Aug 3rd, 2002, 09:21 AM
#12
Thread Starter
Junior Member
It's gotta be, because trying a few more of the changes still yields errors. Time to get out the fine tooth comb it sounds like...
-
Aug 3rd, 2002, 09:59 AM
#13
Thread Starter
Junior Member
Well, a little update. I solved the problem. On some accessory forms, I had them closing with just . I changed them to and it now runs. Thanks for your help everyone, and I'm sorry that vbCrLf wasn't the issue. But I did learn some stuff, such as the ControlChars.NewLine commands.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|