Pelles C forum

C language => Beginner questions => Topic started by: Seltsamuel on February 07, 2010, 05:38:30 PM

Title: colorize scrollbar inside a listbox how?
Post by: Seltsamuel 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
Title: Re: colorize scrollbar inside a listbox how?
Post by: DMac 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.
Title: Re: colorize scrollbar inside a listbox how?
Post by: Seltsamuel 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