NO

Author Topic: colorize scrollbar inside a listbox how?  (Read 2343 times)

Seltsamuel

  • Guest
colorize scrollbar inside a listbox how?
« on: February 07, 2010, 05:38:30 PM »
Hi,

im getting nuts, is there a way to change the colors of a scrollbar inside a normal listbox?
the listbox is inside a greater dialog.

Thanks in advance.

Greetings

Seltsamuel

Offline DMac

  • Member
  • *
  • Posts: 272
Re: colorize scrollbar inside a listbox how?
« Reply #1 on: February 10, 2010, 05:37:10 PM »
The scrollbar in the list box is not actually a scrollbar component, it is drawn.  As such it is not possible to get an handle for it and WM_CTLCOLOR... messages do not work. 

You could subclass the list box and paint your own scrollbar in the WM_NCPAINT handler.  Another option might be to subclass the list box and add a scroll bar control as a child placing it on top of the list box's scroll bar.

Neither of these ideas would appeal to me.

Perhaps you could use a list view instead.  It could be configured to look and behave like a list box and it uses actual scroll bars so the WM_CTLCOLOR messages should work.
No one cares how much you know,
until they know how much you care.

Seltsamuel

  • Guest
Re: colorize scrollbar inside a listbox how?
« Reply #2 on: February 12, 2010, 12:35:26 AM »
Hi,

The more i get comfortable with Windows Programming the more i get the opinion the developers at Microsoft are simply nuts. I try rethinking my dialog to use a listview but i used a listbox because of the scrollable imagebuttons i placed there, what a holy crap.

Thanks for the answer.

Greetings

Seltsamuel