Usually checkbox checkbox control is possible when clicking on text. How to achieve the same with CheckListBox?

    1 answer 1

    you can manually set a flag when clicking into the text by manually processing the click event in the listbox. For example:

    procedure TForm1.CheckListBox1Click(Sender: TObject); var p : TPoint; idx : integer; begin p := CheckListBox1.ScreenToClient(Mouse.CursorPos); idx := CheckListBox1.ItemAtPos( p, true); if idx >= 0 then begin CheckListBox1.Checked[idx] := not CheckListBox1.Checked[idx]; if(assigned(CheckListBox1.OnClickCheck)) then begin CheckListBox1.OnClickCheck(sender); end; end; end; 
    • Good decision, I did the same with ItemIndex, but so pressing the square does not work - RodGers