Link to home
Start Free TrialLog in
Avatar of trouvain
trouvain

asked on

Checkboxes in CListCtrl via StateImages

I'm looking for a solution:
I intend to implement a CListCtrl (Reportstyle) with Checkboxes at the head of each line (like CCheckBox).
I've created two state icons (checked, unchecked). But the problem that occured was that if I try to click on the checkbox nothing changed respectively the state of another line which was selected changed. Furthermore I don't only want to change thy state but to open an dialog at a double click to get more information from the user.
Thus my accurate questions:
- How can I include the checkbox range into the selection?
- How can I change the state of the checkbox by a single click on the checkbox field (like the CListBox behaviour)?
- How can I effectively open an dialog by a double click (Override WM_...)?
- How can I simply implement a functionality for exchanging two lines? I've tried this but every time the selection of the line I wanted to go down or up was gone.

I would be very grateful if if you could could show me the source code for a 3 row Control like discribed above.
Thank in advance.
Avatar of gelbert
gelbert

Take a look at samples\mfc\general\rowlist. To open dialog overide handle of WM_LBUTTONDBLCLK in your CListCtrl derived class and create and open dialog inside this function.
ASKER CERTIFIED SOLUTION
Avatar of RONSLOW
RONSLOW

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of trouvain

ASKER

Thsnx but you could be more specific