I have skinned most controls in my Winform app, except 开发者_开发问答the ScrollBar in ComboBox, Any ideas?
Thanks.
(I use C#/.NET 2.0)
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.
Probably looking into skin scroll-bars for Panels would help.
精彩评论