Solved

Adding checkboxes to a Clistctrl

Posted on 2004-04-11
2
374 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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.
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Suggested Courses

635 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