Сделайте проще, где-то так:
Код:
procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState);
begin
if ListBox2.Items.IndexOf(ListBox1.Items[Index]) = -1
then TListBox(Control).Canvas.Brush.Color := clRed
else TListBox(Control).Canvas.Brush.Color := clWhite;
TListBox(Control).Canvas.FillRect(Rect);
TListBox(Control).Canvas.TextOut(Rect.Left, Rect.Top, ListBox1.Items[Index]);
end;
procedure TForm1.ListBox2DrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState);
begin
if ListBox1.Items.IndexOf(ListBox2.Items[Index]) = -1
then TListBox(Control).Canvas.Brush.Color := clRed
else TListBox(Control).Canvas.Brush.Color := clWhite;
TListBox(Control).Canvas.FillRect(Rect);
TListBox(Control).Canvas.TextOut(Rect.Left, Rect.Top, ListBox2.Items[Index]);
end;