By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,779 Members | 1,498 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,779 IT Pros & Developers. It's quick & easy.

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

P: n/a
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 ????

--
Message posted via http://www.dotnetmonster.com
May 16 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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.
--
HTH
Stoitcho Goutsev (100)

"Paul_Madden via DotNetMonster.com" <u21795@uwe> wrote in message
news:60556bebe8bab@uwe...
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 ????

--
Message posted via http://www.dotnetmonster.com

May 16 '06 #2

P: n/a
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.
Stoitcho Goutsev (100) wrote:
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 ????


--
Message posted via http://www.dotnetmonster.com
May 17 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.