Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I try to draw draw a check box in my CList, my code:

<pre>CRect rect;

	m_listMia.GetSubItemRect(0, 8, LVIR_BOUNDS, rect);
	
	CButton myButton1;

	BOOL b;

     b = myButton1.Create(_T("My button"), WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, rect, &m_listMia, 1);



but it doesn't work, so button isn't drawn

What I have tried:

I tried code that I've written
Posted
Updated 29-Nov-22 5:17am
Comments
jeron1 29-Nov-22 10:11am    
Not a lot of code there. I'm guessing you're referring to CListCtrl? If so, perhaps check this article for adding checkboxes.
https://www.codeproject.com/Articles/13586/Using-Check-Box-in-List-Control
Member 14594285 29-Nov-22 10:16am    
I've seen this class but my methos if is correct is faster
jeron1 29-Nov-22 11:04am    
So you've gotten it to work using another method, but it was too slow?
Member 14594285 29-Nov-22 10:13am    
yes CListCtrl

1 solution

I have used a control derived from CListCtrl that I found here many years ago to do this. It works quite well and I highly recommend it : Another Report List Control[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900