title: How to disable CheckListBox scroll when the last item is clicked?
body: <p>If there are enough items in the CheckListBox, so it has a scrollbar, whenever the last item is clicked it scrolls to the next one, which results in undesired behaviour: </p>
  
  <ul>
  <li>checking/unchecking the next item instead of the one I clicked</li>
  </ul>
  
  <p>Tested it in both Delphi XE7 and a newer version, the 10.2 Tokyo and it does the same thing</p>
  
  <p>Tried capturing the WM_LBUTTONDOWN message and track it, which resulted in finding the exact place things happen.</p>
  
  <p>Vcl.Controls.pas</p>
  
  <pre><code>...
  procedure TControl.WMLButtonDown(var Message: TWMLButtonDown);
  begin
    SendCancelMode(Self);
  
    inherited; //there it scrolls by 1 line
  
    if csCaptureMouse in ControlStyle then
      MouseCapture := True;
    if csClickEvents in ControlStyle then
      Include(FControlState, csClicked);
  
    DoMouseDown(Message, mbLeft, []); // it does the check/uncheck
  end;
  ...
  </code></pre>
  
  <p>Code for reproduction: (and drop a TCheckListBox on the form)</p>
  
  <pre><code>...
  
  procedure TForm1.FormCreate(Sender: TObject);
  var
    i: Integer;
  begin
    CheckListBox1.Height := 145; //just so it's short enough
    for i := 0 to 30 do
    begin
  CheckListBox1.Items.Add('Item'+IntToStr(i));
    end;
  end;
  ...
  </code></pre>
  
  <p>Then click the chechbox of item that shows on the bottom</p>
  
  <p>Also tried to go trough the unit, which contains evertything about the CheckListBox (Vcl.CheckLst, but haven't found anything usable</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>BrakNicku discovered he could only reproduce it with partial items, which seems to be the case for me as well</p>
  
  <p>His solution: Set the IntegralHeight property to True, so it prevents this problem.</p>