joeybagadonutz Posted March 25, 2004 Posted March 25, 2004 Hi, i cant figure out how to put a simple carriage return or new line in a string, what am i doing wrong? the below comes out all on the same line. thanks. Dim sbody As New StringBuilder For i = 0 To ds.Tables("includes").Rows.Count.ToString - 1 sbody.Append(ds.Tables("includes").Rows(i).Item("description") & vbCrLf) Next lblincludes.Text = sbody.ToString Quote
Moderators Robby Posted March 25, 2004 Moderators Posted March 25, 2004 ControlChars.NewLine Quote Visit...Bassic Software
joeybagadonutz Posted March 25, 2004 Author Posted March 25, 2004 ControlChars.NewLine okay, i tried this: Dim sbody As New StringBuilder For i = 0 To ds.Tables("includes").Rows.Count.ToString - 1 sbody.Append(ds.Tables("includes").Rows(i).Item("description") & ControlChars.NewLine) Next lblincludes.Text = sbody.ToString Still no carriage returns. Am I missing something? Quote
Leaders Iceplug Posted March 25, 2004 Leaders Posted March 25, 2004 Try: sbody.Append(ds.Tables("includes").Rows(i).Item("description")) sbody.Append(System.Environment.NewLine) :) Quote Iceplug, USN One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(
joeybagadonutz Posted March 25, 2004 Author Posted March 25, 2004 Try: sbody.Append(ds.Tables("includes").Rows(i).Item("description")) sbody.Append(System.Environment.NewLine) :) Hi, unfortunately I tried the system.environment.newline as well and it doesnt work either. do you think it might have somthing to do with the settings for the label im using to output it maybe? Quote
iebidan Posted March 25, 2004 Posted March 25, 2004 I think the using chr(10) will help something like Dim xx As String = "HELLO" & chr(10) & "WORLD" Quote Fat kids are harder to kidnap
techmanbd Posted March 25, 2004 Posted March 25, 2004 Ok try this, I am thinking that whatever you are appending to you are not leaving a space inbetween the text and vbcrlf so is see the vbcrlf as part oif the text instead of the newline sbody.Append(ds.Tables("includes").Rows(i).Item("description") & " " & vbCrLf) This I am just guessing but who knows Quote Live as if you were to die tomorrow. Learn as if you were to live forever. Gandhi
Leaders Iceplug Posted March 26, 2004 Leaders Posted March 26, 2004 Hi' date=' unfortunately I tried the system.environment.newline as well and it doesnt work either. do you think it might have somthing to do with the settings for the label im using to output it maybe?[/quote'] Hmm: Try assigning directly to the label... maybe it's a problem there. lblIncludes.Text = "Hi!" & System.Environment.NewLine & "Hi!" (do you see Hi! on two lines?) I don't think there's a Multiline property on a label. Is your label big enough so that you see your text on more than one line? Quote Iceplug, USN One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(
Moderators Robby Posted March 27, 2004 Moderators Posted March 27, 2004 HOw do you expect this to work??? For i = 0 To ds.Tables("includes").Rows.Count.ToString - 1 Why would you convert the count to strng? The first thing you need to do is place Option Strict at the top of every code page. Quote Visit...Bassic Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.