自定义画Windows窗体滚动条?
我知道如何自定义绘制独立的 Windows 窗体 ScrollBar,因为在 codeproject.com 等地方有很多示例。 但是如何在不是您自己创建的控件中自定义绘制滚动条呢? 例如,面板可以显示滚动条,但我如何确保它显示的滚动条是自定义绘制的?
或者也许这是不可能的,我需要创建我自己的面板版本,以便他们使用我自己的自定义绘图滚动条?
I know how to do custom drawing of a standalone Windows Forms ScrollBar because there are plenty of examples at places like codeproject.com. But how do you custom draw the scrollbars in controls you do not create yourself? For example a Panel can show scrollbars but how would I ensure that the scrollbars it shows are custom drawn?
Or maybe this is not possible and I would need to create my own version of a Panel so that they use my own custom drawing scrollbars?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您最常看到的滚动条(包括大多数 winforms 控件中内置的滚动条)由 Windows 呈现,并且无法在 WinForms 中覆盖它们的外观,除非实现完全自定义的解决方案来完全接管常见滚动条控件的呈现和行为。 有一些商业包声称可以做到这一点(google winforms Skinning)。
The scrollbars you see most often, including those built into most winforms controls, are rendered by Windows and there is no way to override their appearance in WinForms short of implementing an entirely custom solution which completely takes over the rendering and behavior of the common scrollbar control. There are some commercial packagages which claim to do this (google winforms skinning).