0

On my CDialog I have two CListBox classes:

enter image description here

  • The top one is a standard list box with extended selection style.
  • The bottom one is a derived CCheckListBox.

I don't want the user to be able to physically adjust the "selection" in the top listbox. This is because the bottom listbox is in charge. When you select an item in the bottom one it performs some operations to decide which items to select in the top one.

I can't set the selection mode to "None" because then I can't select items programatically. So how can I set the top list box to disallow selection from a users perspective?

Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
  • I don't think that the suggested solution is the best one. Couldn't yo just disable your first listbox? – Vlad Feinstein Mar 30 '22 at 19:07
  • 1
    @VladFeinstein Not really because I want the highlight scheme to look the same. And if it was disabled they couldn’t scroll list of names if there were a lot. It is working ok. I use PTM and LBUTTONDOWN. – Andrew Truckle Mar 30 '22 at 19:38
  • 1
    @VladFeinstein I also compare the message handle against the lb handle. – Andrew Truckle Mar 30 '22 at 19:51

0 Answers0