In my Delphi 7 app I have a listbox and buttons to enable the user to move items up or down in the listbox. However, as soon as either button is clicked the highlight in the list box disappears. I would like to keep the highlight and have tried using SendMessge with the LB_SETCARETINDEX message but this does not work. The code is below and I would like to know how to get this to work.
procedure TfrmMain.cmdMoveUpClick(Sender: TObject);
var CurrIndex: integer;
with lstSelectedImages do
if ItemIndex > 0 then begin
Items.Move(ItemIndex, (CurrIndex - 1));
SendMessage(lstSelectedImages.Handle, LB_SETCARETINDEX, ItemIndex, 0);