Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 391
  • Last Modified:

Adding checkboxes to a Clistctrl

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
csuog
Asked:
csuog
  • 2
1 Solution
 
caner_elciCommented:
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
 
caner_elciCommented:
Here is the code :

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

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now