Windows 7 中的滚动条外观控制
我有一个应用程序,它有一个带有滚动条的 ListView 控件,并且它自动具有看起来很酷的滚动条:
CreateWindowExW(WS_EX_WINDOWEDGE,L"SysListView32",L"MyList",
WS_CHILD|WS_VISIBLE|LVS_NOSCROLL|LVS_REPORT|LVS_NOCOLUMNHEADER|WS_VSCROLL|LVS_SHOWSELALWAYS| LVS_SINGLESEL,
0,0,500,290,ownerhWnd, (HMENU)0,hInst,NULL);
但是,当我为应用程序的另一部分手动创建滚动条控件时,它具有较旧的 3d 风格外观:
CreateWindow(TEXT("SCROLLBAR"), TEXT("MyScrollBar"),
WS_CHILD | WS_VISIBLE | SBS_VERT,0,0, CW_USEDEFAULT,
100, ownerhWnd, (HMENU)10 , NULL, NULL);
如何我明白它有新的外观吗?是否有我使用的其他控件,或者我可以应用于标准控件的样式?我查看了平面滚动条,但它说从 XP 开始不支持它?
谢谢
I have an application that has a ListView control with scrollbars, and it has the cool looking scrollbars in it automatically:
CreateWindowExW(WS_EX_WINDOWEDGE,L"SysListView32",L"MyList",
WS_CHILD|WS_VISIBLE|LVS_NOSCROLL|LVS_REPORT|LVS_NOCOLUMNHEADER|WS_VSCROLL|LVS_SHOWSELALWAYS| LVS_SINGLESEL,
0,0,500,290,ownerhWnd, (HMENU)0,hInst,NULL);
However, when I create a Scrollbar control manually for another part of the application, it has the older 3d-style look:
CreateWindow(TEXT("SCROLLBAR"), TEXT("MyScrollBar"),
WS_CHILD | WS_VISIBLE | SBS_VERT,0,0, CW_USEDEFAULT,
100, ownerhWnd, (HMENU)10 , NULL, NULL);
How do I get it to have the new look? Is there another control I use, or a style that I can apply to the standard control? I looked into the Flat Scroll Bar, however it says that it is not supported from XP onwards?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
首先,您需要为您的程序创建一个清单,表明它使用 Common Controls 版本 6。然后您必须在程序启动时调用
InitCommonControls
。详细信息可在此 Microsoft 页面上找到:
http:// /msdn.microsoft.com/en-us/library/bb773175%28v=vs.85%29.aspx
First, you need to create a manifest for your program that indicates it uses Common Controls version 6. Then you have to call
InitCommonControls
at program startup.Details are found on this Microsoft page:
http://msdn.microsoft.com/en-us/library/bb773175%28v=vs.85%29.aspx
也许是一扇敞开的门,但您已将 Windows XP/Vista/7 清单添加到应用程序的资源中?
Maybe an open door, but you have added a Windows XP/Vista/7 manifest to your application's resources?