Change LVS_ALIGNLEFT by LVS_ALIGNTOP
-
How can I change
LVS_ALIGNLEFT
byLVS_ALIGNTOP
(of an CListCtrl) at runtime ? The list hasLVS_ICON
style already ... Thank you. -
How can I change
LVS_ALIGNLEFT
byLVS_ALIGNTOP
(of an CListCtrl) at runtime ? The list hasLVS_ICON
style already ... Thank you.What you are looking for is the funtion CWnd::ModifyStyle.
The good thing about pessimism is, that you are always either right or pleasently surprised.
-
What you are looking for is the funtion CWnd::ModifyStyle.
The good thing about pessimism is, that you are always either right or pleasently surprised.
-
I tried both solutions:
ListView_SetExtendedListViewStyleEx(m_List.GetSafeHwnd(), LVS_ALIGNMASK, LVS_ALIGNLEFT);
and
m_List.ModifyStyle(LVS_ALIGNTOP, LVS_ALIGNLEFT);
none of them are working ... I am not figure out why ...
-
You need to use
DWORD dwStyle = GetWindowLong(m_hWnd, GWL_STYLE);
// modify the style mask as required
SetWindowLong(m_hWnd, GWL_STYLE, dwStyle);There are probably some MFC shortcuts to this.
-
"There are probably some MFC shortcuts to this" Yes, there is ModifyStyle (ModifyStyleEx), but seems not working either ...
-
"There are probably some MFC shortcuts to this" Yes, there is ModifyStyle (ModifyStyleEx), but seems not working either ...
-
I noticed something: in order to work correctly, before I change the aligment style, I have to setup scrollbars of list control to top/bottom ... orelse, the list looks uggly (all items are bad drawned) ... it is logical to happend that ? I am thinking that if I setup vertical scrollbar on some position, if I change the aligment style to horizontal, it doesn't fit at he same horizontal position ...