开发者

Winforms: How to Skin Scrollbar in ComboBox?

开发者 https://www.devze.com 2022-12-25 21:23 出处:网络
I have skinned most controls in my Winform app, except 开发者_开发问答the 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)


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消