VB.Net listBox - smooth scrolling - owner drawn listBox

L

LostInMd

Hi All,

I've got an owner drawn listBox where I draw and measure the items that I add
to the listBox. For example, I have a listBox that can only display 10
characters on each horizontal line. The majority of my items contain much
more than 10 characters and thus the reason for my use of owner drawn
listBoxes - I do not want to use a horizontal scrollbar, instead I want the
text of each item to wrap onto multiple lines. I do use a vertical scrollbar.
My problem occurs when one of my items contains text that wraps onto more
lines than can be displayed within the listbox. For example, the user can
only see 5 lines of text in the listBox. If I have 5 items, all with only
one line of text, the user can see all items in the listBox. If I have 1
item with 5 lines of wrapped text, the user can see the entire item in the
listBox. If I have 1 item with 6 lines of wrapped text in a listBox that is
only tall enough to display 5 lines of text, the user can only see the top 5
lines of wrapped text and the last (6th) line of wrapped text is not visible
to the user. When I use the vertical scrollbar to attempt to view the last
(6th) line of text, I am not able to.

If I have 2 items in my listBox, both with wrapped lines of more than 5
(taking into account that the listBox is only tall enough to display 5 lines
of text), for the first item I am able to see the top 5 lines of text, and
when I use the vertical scrollbar to view the remaining wrapped lines of the
first item, rather than seeing the remaining lines of text for the first item,
I see the first 5 lines of wrapped text for the second item.

I am assuming that this is because listBoxes items are defaulted to only one
line of text, thus the need for smooth scrolling (as is available with a
textBox) is not available. Does anyone know what I can add/adjust so that I
can allow the user to view the remaining lines wrapped text for an item that
contains more wrapped lines of text than can be displayed in a listBox,
without using a horizontal scrollbar?

Thanks in advance for any suggestions y'all can offer!
 

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