简体   繁体   中英

How to change the border color of a ListView in WinAPI?

I have noticed that the border color for a ListView in WinAPI is different from .NET:

在此处输入图片说明

Why is it different in .NET? I assume that the .NET code that creates the ListView simply calls CreateWindowEx() , so does .NET also calls another code that changes the border color?

You are probably using this:

CreateWindowEx(0, WC_LISTVIEW, 0, WS_BORDER | WS_VISIBLE | WS_CHILD...)

Don't set WS_BORDER flag. Instead use WS_EX_CLIENTEDGE for dwExStyle :

CreateWindowEx(WS_EX_CLIENTEDGE, WC_LISTVIEW, 0, WS_VISIBLE | WS_CHILD...)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM