Jump to content
View in the app

A better way to browse. Learn more.

Tuts 4 You

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Checkboxes in multiple columns in Visual C++ 6 ???

Featured Replies

Posted

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?
 

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

  • 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.
 

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.