Change listview style at runtime
LVS_NOCOLUMNHEADER is a style for listview control which forces header to hide.
Now, if I did not use it while creating the control, what is the way to add this style to listview control?
I tested it cannot be set using ListView_SetExtendedListViewStyle, since it is not extended style.
waiting for kind reply.
Re: Change listview style at runtime
Did you try
Code:
SetWindowLong(listView, GWL_STYLE, GetWindowLong(listView, GWL_STYLE) | LVS_NOCOLUMNHEADER);
Re: Change listview style at runtime
Thanks, it means LVS_????? styles can directly be added and removed at runtime.
I was under impression that these might not work by simply adding to or removing from style.
thanks kkez ;)
regards
Re: Change listview style at runtime
Extended styles , by Microsoft naming convention, have the _EX_ in them, for e.g. LVS_EX_CHECKBOXES. These are the styles for which you would use the Extended macros.
As for which styles can be changed at runtime, it is best to refer to Microsoft documentation of the control. If there are certain styles that cannot be changed after creating the control, the documentation will indicate so at the top like
Quote:
Originally Posted by msdn
After the control has been created, these styles cannot be modified, except as noted.
e.g. here, for ES_LOWERCASE , the documentation explicitly says it can be changed.
For listview control styles, I don't see such statements, so I am guessing, one is allowed to change the styles at runtime.
https://msdn2.microsoft.com/en-us/library/ms670561.aspx
Re: Change listview style at runtime
Was successful.
Thanks alot for the references.
regards