Hello,

I have a CListCtrl and a button to modify the selected row in the CListCtrl.
My problem is that my list has several columns and I want to be able to select a row by clicking on any column of the row that I want selected. Now I can only select a row by clicking on the value found on it's first column. I think it's something about the CListCtrl propertyes , but can't figure out what has to be set.

Thx in advnace

The solution is to find out what is the difference between clicking on the first column and clicking on the second column. In both cases I think your program should get the click event.

Sorry Im not able to get your question.

1) Do you want to select an entire column by clicking on a cell???
2) Or do you want to select the entire row by clicking on a cell???

If your question is No:2 u need to set a style for the list control.

m_ListCtrl.SetExtendedStyle( m_ListCtrl.GetExtendedStyle() | LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT )

If your question is No:1 then u need to seperately handle it. There is no styles for that

I acknowledge the answer given my Mr.Rajith.

For full row select , the style LVS_EX_FULLROWSELECT will do

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.