Handling Listbox DrawItem event, now Horizontal scrollbar is broken ???

  • Thread starter Paul_Madden via DotNetMonster.com
  • Start date
P

Paul_Madden via DotNetMonster.com

I am handling the Listbox DrawItem event to enable the listbox strings to be
displayed in different colours for easy reading.

Have set ScrollAlwaysVisible and HorizontalScrollbar to true.

I Anchor the listbox T, L, R, B on the parent form

The string items held within the listbox are quite big, much longer than
could be displayed within the Listbox display area.

When I expand the parent form then more of the string is displayed.

Problem is the Horizontal scroolbar may as well not be there as it constantly
implies there is nothing outside the display area, to display.

Do I need to handle this somehow within the DrawItem event ????
 
S

Stoitcho Goutsev \(100\)

Paul,

I don't know if it helps, but set the DrawMode to OwnerDrawVariable and
handle the MeasureItem event.

In this case the list box will have all information on the size of the items
and probably will update the scrollbar accordingly.

BTW I didn't quite understand what is the problem with the scrollbar.
 
P

Paul_Madden via DotNetMonster.com

Hoi Stoitcho.

Have actually tried the approach you suggested but no joy. The problem is the
following. If my Items (strings) are much too long to be displayed within the
Listbox display window, the scrollbar area is present on the bottom of the
display area, but there is NO scrollbar proper within the scrollbar area,
implying all data for the Items is visible already in the Listbox display
area. When I set the DrawMode to Normal, the slidebar works as expected. As I
say I did try the DrawMode OwnerDrawVariable technique and handle the
MeasureItem event correctly, but still no proper scrollbar support. The
Vertical scrollbar works perfectly fine.

Many thanks for your help and if you can think of anything else (maybe this
is a bug !!) I would appreciate it.

Paul.

Paul,

I don't know if it helps, but set the DrawMode to OwnerDrawVariable and
handle the MeasureItem event.

In this case the list box will have all information on the size of the items
and probably will update the scrollbar accordingly.

BTW I didn't quite understand what is the problem with the scrollbar.
I am handling the Listbox DrawItem event to enable the listbox strings to
be
[quoted text clipped - 14 lines]
Do I need to handle this somehow within the DrawItem event ????
 

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