Scrollbar Appearance Control in Windows 7

别等时光非礼了梦想. 提交于 2019-12-11 10:57:50

问题


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


回答1:


Maybe an open door, but you have added a Windows XP/Vista/7 manifest to your application's resources?




回答2:


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



来源:https://stackoverflow.com/questions/6078159/scrollbar-appearance-control-in-windows-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!