Chris
Chris

Reputation: 13

Winforms: How to Skin Scrollbar in ComboBox?

I have skinned most controls in my Winform app, except the ScrollBar in ComboBox, Any ideas?

Thanks.

(I use C#/.NET 2.0)

Upvotes: 1

Views: 2541

Answers (2)

Hans Passant
Hans Passant

Reputation: 941545

Well, this is indeed tricky. The dropdown listbox gets created dynamically when the user clicks the arrow. It is an entirely unmanaged window, Windows Forms doesn't wrap it.

What you need to do is send the CB_GETCOMBOBOXINFO message in an override for ComboBox.OnDropDown to get the window handle, it is return in the COMBOBOXINFO.hwndList. From there, I'd have to assume you already have the P/Invoke to skin the scrollbar of a ListBox.

Part of the code you'll need you'll find in my post in this thread.

Upvotes: 1

Kamran Khan
Kamran Khan

Reputation: 9986

Probably looking into skin scroll-bars for Panels would help.

Upvotes: 0

Related Questions