Solved

Adding checkboxes to a Clistctrl

Posted on 2004-04-11
2
371 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

Suggested Solutions

Title # Comments Views Activity
List out all word 7 359
modThree challenge 4 155
withoutTen challenge 14 142
Line meaning 9 99
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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

710 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