Opened 10 years ago

Closed 10 years ago

#12705 closed defect (fixed)

Multiple list boxes deselection does not work

Reported by: mycae Owned by:
Priority: normal Milestone:
Component: wxMSW Version:
Keywords: Cc:
Blocked By: Blocking:
Patch: no


As discussed at the following link, the sample listbox, if set to multiple selection style, cannot be deselected with SetSelection(wxNOT_FOUND), as stated in the documentation. This occurs purely under windows 7 and is fine under OSX and under GTK. This can be worked around with SetSelection(-1,false), however.

Change History (1)

comment:1 Changed 10 years ago by VZ

  • Resolution set to fixed
  • Status changed from new to closed

(In [66243]) Deselect all items in wxMSW wxListBox when selection is set to -1.

Even though this behaviour is somewhat counterintuitive, the documentation
mentions that this is what should happen and wxGTK and wxOSX already behave
like this so bring wxMSW in line.

wxListBox::DeselectAll() should probably just call SetSelection(wxNOT_FOUND)
when the item to leave selected is not specified too now.

Closes #12705.

Note: See TracTickets for help on using tickets.