TabControl 中的轨迹栏背景
我在 TabControl 内的 TabPage 上有一个 TrackBar 控件。 TrackBar 的背景绘制为灰色,而 TabPage 的背景绘制为白色。 无法将 TrackBar 的 BackColor 属性设置为透明,并且我无法覆盖绘图,因为 TrackBar 没有 DrawMode 属性。 我必须有哪些选项才能使 TrackBar 适合? 为什么它不支持视觉样式?
I have a TrackBar control on a TabPage inside a TabControl. The background of the TrackBar is being drawn in grey while the TabPage is being drawn as white. There is no way to set the BackColor property of the TrackBar to transparent, and I can't override the drawing because there is no DrawMode property for the TrackBar. What options do I have to make the TrackBar fit in? Why doesn't it support visual styles?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
简单
我也面临着这个问题(需要在选项卡控件上有一个透明背景的轨迹栏,它将与启用和禁用的视觉样式一起使用)。 这对我有用。
Simple
I also faced this (needed a transparent-background trackbar on a tab-control, that will work with both visualstyles enabled and disabled). And this worked for me.
不会在这里干涉,但上述建议都不适合我。
诀窍是以下几行:
所以我基本上消除了背景颜色中的 alpha 通道。 不过,仍然需要在 Vista 和 Win 7 上进行测试。
Wouldn't interfere here, but neither of the above suggestions worked for me.
What did the trick were the following lines:
So I basically eliminate the alpha channel from the background color. Still have to test this with Vista and Win 7, though.
您可能想查看 CodePlex 上的 TransparentTrackBar 项目。
You might want to look at the TransparentTrackBar project on CodePlex.
显而易见的解决方案似乎是将 TrackBar 的 BackColor 设置为 System-ControlLightLight。
(但是对于四年前的问题的明显解决方案的问题是,它可能意味着我误解了某些东西。)
The obvious solution seems to be to set the TrackBar's BackColor to System-ControlLightLight.
(But the problem with an obvious solution to four-year-old question is that it probably implies that I've misunderstood something.)