Reputation: 13
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
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