FNCListBox: unselect from code

Dear all,


maybe my coffee level is to low. How do I unselect items in an FNCListBox via code?

My initial approach was

FNCListBox.Items.isSelect := false;

IsSelected is read-only for items and ClearSelection does not exist.

Thanks for your help

This was not yet possible, we have improved this behaviour now. The next version will have the ItemIndex property that can be used with a -1 to clear selection.

Thanks for the info, I actually need it to reset a multiselect situation. Looking forward to the update

Hi, 


You can also use the following code:



type
  TTMSFNCListBoxOpen = class(TTMSFNCListBox);


procedure TForm46.Button1Click(Sender: TObject);
begin
  TTMSFNCListBoxOpen(TMSFNCListBox1).TreeView.UnSelectAllVirtualNodes;
end;

Dear Pieter,


brief question: is a solution implemented in 2.2. or should I still use the typecast?

Kind regards
Gernot

Hi, 


The TTMSFNCListBox has an UnSelectAllItems method in 2.2

Perfect, many thanks