Posted August 31, 20231 yr Checkboxes in multiple columns in Visual C++ 6 ??? References: https://stackoverflow.com/questions/27309526/how-to-add-checkboxes-in-multiple-columns-in-vc https://www.codeproject.com/Articles/29064/CGridListCtrlEx-Grid-Control-Based-on-CListCtrl I can't find simple solutions, m_List.SetExtendedStyle(LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT | LVS_EX_SUBITEMIMAGES | LVS_EX_CHECKBOXES ); int itemPos, x; CString data; m_List.InsertColumn(0,"Column 1",LVCFMT_LEFT,100); m_List.InsertColumn(1,"Column 2",LVCFMT_LEFT,100); m_List.InsertColumn(2,"Column 3",LVCFMT_LEFT,100); for (x=0;x<3;x++) { data.Format("(%d,1)",x); itemPos=m_List.InsertItem(x,data); data.Format("(%d,2)",x); m_List.SetItemText(itemPos,1,data); data.Format("(%d,3)",x); m_List.SetItemText(itemPos,2,data); } The first thing to do is set List Control on Style View as Report. But as said in the article, only first column has checkbox. How to fix it?
August 31, 20231 yr One of the examples listed at codeproject (https://www.codeproject.com/Articles/1796/XListCtrl-A-custom-draw-list-control-with-subitem) uses customdraw to draw the checkboxes A DrawCheckbox function is called during the OnCustomDraw procedure. Obviously the custom listview also has to store and check the checked status of the subitems in some sort of array. Some more info about custom draw for some common controls can be found here: https://learn.microsoft.com/en-us/windows/win32/controls/about-custom-draw
September 1, 20231 yr Author https://stackoverflow.com/questions/61033152/mfc-clistctrl-rows-with-optional-checkboxes and https://www.codeproject.com/Articles/5032/Creating-and-Using-custom-controls-in-VC I have problems with creating custom controls, Visual C++ 6 program just exist.
September 1, 20231 yr Author https://www.codeproject.com/Articles/13586/Using-Check-Box-in-List-Control I found that for custom controls I should just add class to project .cpp +.h files and then create control value with type new added class. https://forums.codeguru.com/showthread.php?473168-List-Control-changing-sub-items-image this draw image. The working one is CQuickList https://www.codeproject.com/Articles/8112/CQuickList https://forum.sources.ru/index.php?showtopic=136180 but I don't know how to use it at this moment.
September 1, 20231 yr There is a demo poject quicklist_demo.zip - you could learn how CQuickList control is being used...t and WOW - this project is almost 20 years old! but still fully functional
Create an account or sign in to comment