Solved

Adding checkboxes to a Clistctrl

Posted on 2004-04-11
2
370 Views
Last Modified: 2013-11-20
Hi Experts,

In my application I want each row in the first column of my listctrl to contain a single checkbox.  I've trawled the net and looked at a couple of articles on codeproject but can't seem to get the checkboxes to appear.  I would prefer to avoid custom painting the clistctrl but can do if thats the only solution.  

Any help would be much appreciated

Thanks in advance

Stuart
0
Comment
Question by:csuog
  • 2
2 Comments
 
LVL 4

Expert Comment

by:caner_elci
ID: 10801123
You'll need to set the extended style LVS_EX_CHECKBOXES to have checkboxes.. then, you can use GetCheck() and SetCheck() to get the check state of an item..
0
 
LVL 4

Accepted Solution

by:
caner_elci earned 100 total points
ID: 10801144
Here is the code :

m_wndList1.GetListCtrl().SetExtendedStyle( m_wndList1.GetListCtrl().GetExtendedStyle() | LVS_EX_CHECKBOXES );
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
windows 10 how make picture as desktop background 2 66
sumHeights  challenge 17 78
Path of Workbook 3 86
Problem to App source 6 89
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question