How to display some text into a "listbox"?

K

kimiraikkonen

Hi experts,
I need to display some custom text ouptut in a Listbox and the first 4
lines of listbox (index items) will be removed.

the problem is not to know how to display custom text "line by line"
in a Listbox?

Thanks...
 
H

Herfried K. Wagner [MVP]

kimiraikkonen said:
I need to display some custom text ouptut in a Listbox and the first 4
lines of listbox (index items) will be removed.

the problem is not to know how to display custom text "line by line"
in a Listbox?

I fear I do not completely understand the problem. Are you using a data
source or data binding to fill the control or are you filling it using
'<ListBox>.Items.Add'?
 
K

kimiraikkonen

Hi,
I don't know the exact phase calling it in VB, but the thing i want to
perform is:

Think a textbox, i want to display it's content "as same as" in
listbox and every sentence in text must be displayed as lines, line by
line.

How is it possible?

For example: A text box shows: "This group is very useful.
I really like to be
helped by experts..."

Listbox must show: This group is very useful ---
This is line1 (item 1)
I really like to be
helped by experts --------This is line2 (item 2)

Thanks...
 
H

Herfried K. Wagner [MVP]

kimiraikkonen said:
Think a textbox, i want to display it's content "as same as" in
listbox and every sentence in text must be displayed as lines, line by
line.

How is it possible?

For example: A text box shows: "This group is very useful.
I really like to be
helped by experts..."

Listbox must show: This group is very useful ---
This is line1 (item 1)
I really like to be
helped by experts --------This is line2 (item 2)

\\\
Me.ListBox1.Items.AddRange(Me.TextBox1.Lines)
///
 
K

kimiraikkonen

\\\
Me.ListBox1.Items.AddRange(Me.TextBox1.Lines)
///

That's it! Great Thanks. Lastly, how can i cut first 4 lines of
content before displaying and display them with the rest of lines
(first 4 lines mustn't be shown).

Very thanks :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top