问题
How do you prevent a user from resizing the column width of a clistctrl (report view)?
回答1:
You'll have to override theOnNotify
method to catch header's TRACK messages.
Here is a solution: Prevent column resizing
Update: on newer MFC versions and on Vista, there is the LVCFMT_FIXED_WIDTH
format flag.
You can set that flag when you insert the column: see LVCOLUMN Structure
LVCFMT_FIXED_WIDTH
Version 6.00 and Windows Vista. Can't resize the column; same asHDF_FIXEDWIDTH
.
来源:https://stackoverflow.com/questions/1535353/how-do-you-prevent-a-user-from-resizing-the-column-width-of-a-clistctrl-report