Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted
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?

  • Leaders
Posted

Try:

sbody.Append(ds.Tables("includes").Rows(i).Item("description"))

sbody.Append(System.Environment.NewLine)

:)

Iceplug, USN

One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(

Posted
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?

Posted

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

Live as if you were to die tomorrow. Learn as if you were to live forever.
Gandhi
  • Leaders
Posted
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?

Iceplug, USN

One of my coworkers thinks that I believe that drawing bullets is the most efficient way of drawing bullets. Whatever!!! :-(

  • Moderators
Posted

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.

Visit...Bassic Software

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...