Reputation: 6675
I am customizing Win32 ListView control and I want to remove the vertical line that is automatically drawn when I resize the headers. I am talking about the line drawn in the row area not in the header. The vertical tracking line can be restricted by handling the HDN_TRACK notification and changing the cxy value in notification data but there seems to be no way to restrict or remove the vertical tracking line in the row area. Anyone has any ideas on how to remove/hide/restrict that line?
The above screenshot was taken while I am tracking the header
Upvotes: 0
Views: 285
Reputation: 101616
Removing the line just makes it harder for the user to use the control!
The easy method is probably to enable visual styles/comctl32 v6, it seems to use live resizing instead but that might depend on the chosen theme/style.
I was able to come up with a ugly hack for the classic control:
HWND hLV = CreateWindowEx(WS_EX_CLIENTEDGE, WC_LISTVIEW, NULL, WS_CHILD|WS_VISIBLE|WS_HSCROLL|WS_VSCROLL|LVS_REPORT, ...);
SendMessage(hLV, CCM_SETVERSION, 5, 0); // <--- Important
...
case WM_NOTIFY:
{
HWND hLV = ...;
NMHDR&nmh = *(NMHDR*) lparam;
switch(nmh.code)
{
case HDN_BEGINTRACKA:case HDN_BEGINTRACKW:
LockWindowUpdate(hLV); // Block all drawing in the listview
return false;
case HDN_ENDTRACKA:case HDN_ENDTRACKW:
LockWindowUpdate(NULL);
return false;
}
This might depend on the HDS_FULLDRAG header style and you probably don't want to do this when visual styles are enabled.
Upvotes: 1