Sinisterly
ListBox Items - Printable Version

+- Sinisterly (https://sinister.li)
+-- Forum: Coding (https://sinister.li/Forum-Coding)
+--- Forum: Visual Basic & .NET Framework (https://sinister.li/Forum-Visual-Basic-NET-Framework)
+--- Thread: ListBox Items (/Thread-ListBox-Items)



ListBox Items - 1llusion - 03-20-2011

Hi!!!

Well, I need a little help with listbox,

I have an app, and I want to display strings from website, well, when I do it the strings merge into one line like this:
Quote:one[]two[]three[]four
when original text was:

Code:
one two three four

(the [] is a little square between the words)

well, I would need a help how to fix this, or suggest some other contoll that would do the same work, tried richtextbox, but when you make it ReadOnly, it goes in this weird gray/brown colour, and I don't want this Smile

Thanks for help!!!! Have a great day!!!


ListBox Items - 1llusion - 03-20-2011

Hi!!!

Well, I need a little help with listbox,

I have an app, and I want to display strings from website, well, when I do it the strings merge into one line like this:
Quote:one[]two[]three[]four
when original text was:

Code:
one two three four

(the [] is a little square between the words)

well, I would need a help how to fix this, or suggest some other contoll that would do the same work, tried richtextbox, but when you make it ReadOnly, it goes in this weird gray/brown colour, and I don't want this Smile

Thanks for help!!!! Have a great day!!!


RE: ListBox Items - Coder-san - 03-20-2011

It's probably the CrLf character (Chr(13))
Just do this:

Code:
ListBox1.Items.Addrange(Split(strWeb, vbCrLf))



RE: ListBox Items - Coder-san - 03-20-2011

It's probably the CrLf character (Chr(13))
Just do this:

Code:
ListBox1.Items.Addrange(Split(strWeb, vbCrLf))



RE: ListBox Items - 1llusion - 03-20-2011

(03-20-2011, 05:27 PM)Coder-san Wrote: It's probably the CrLf character (Chr(13))
Just do this:

Code:
ListBox1.Items.Addrange(Split(strWeb, vbCrLf))

still the same :/

Here is what I have:
Code:
ListBox1.Items.AddRange(Split(Download(My.Settings.URL), vbCrLf))
(the download(My.Settings.URL) is a function for downloading the strings)

this is the page:
http://glassdragons.myartsonline.com/log.txt

Thanks for help =)


RE: ListBox Items - 1llusion - 03-20-2011

(03-20-2011, 05:27 PM)Coder-san Wrote: It's probably the CrLf character (Chr(13))
Just do this:

Code:
ListBox1.Items.Addrange(Split(strWeb, vbCrLf))

still the same :/

Here is what I have:
Code:
ListBox1.Items.AddRange(Split(Download(My.Settings.URL), vbCrLf))
(the download(My.Settings.URL) is a function for downloading the strings)

this is the page:
http://glassdragons.myartsonline.com/log.txt

Thanks for help =)


RE: ListBox Items - Coder-san - 03-20-2011

For some reason a simple split is not working.
Do this:

Code:
ListBox1.Items.AddRange(Split(strWeb, "Is Online")) For intIndex As Integer = 0 To ListBox1.Items.Count - 2 ListBox1.Items.Item(intIndex) &= "Is Online" Next

If you don't want to split like that, then add a unique delimiter in the end from wherever you are adding the text file from.


RE: ListBox Items - Coder-san - 03-20-2011

For some reason a simple split is not working.
Do this:

Code:
ListBox1.Items.AddRange(Split(strWeb, "Is Online")) For intIndex As Integer = 0 To ListBox1.Items.Count - 2 ListBox1.Items.Item(intIndex) &= "Is Online" Next

If you don't want to split like that, then add a unique delimiter in the end from wherever you are adding the text file from.


RE: ListBox Items - 1llusion - 03-20-2011

(03-20-2011, 06:10 PM)Coder-san Wrote: For some reason a simple split is not working.
Do this:

Code:
ListBox1.Items.AddRange(Split(strWeb, "Is Online")) For intIndex As Integer = 0 To ListBox1.Items.Count - 2 ListBox1.Items.Item(intIndex) &= "Is Online" Next

If you don't want to split like that, then add a unique delimiter in the end from wherever you are adding the text file from.

Thanks a lot for help Smile
I think Ill use both of em, since I'll use more then 1 document Tongue

Thanks again!


RE: ListBox Items - 1llusion - 03-20-2011

(03-20-2011, 06:10 PM)Coder-san Wrote: For some reason a simple split is not working.
Do this:

Code:
ListBox1.Items.AddRange(Split(strWeb, "Is Online")) For intIndex As Integer = 0 To ListBox1.Items.Count - 2 ListBox1.Items.Item(intIndex) &= "Is Online" Next

If you don't want to split like that, then add a unique delimiter in the end from wherever you are adding the text file from.

Thanks a lot for help Smile
I think Ill use both of em, since I'll use more then 1 document Tongue

Thanks again!