views:

215

answers:

2

How do you prevent a user from resizing the column width of a clistctrl (report view)?

A: 

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 as HDF_FIXEDWIDTH.

Nick D
A: 

i get the following error when I used the code snippet at http://www.codeguru.com/cpp/controls/listview/columns/article.php/c1065:

error C2248: 'OnNotify' : cannot access protected member declared in class 'CWnd'

HELP!

aa