Delphi Object and Component Reference
  ItemRect exampleThis example uses a list box on a form. When the user clicks one of the items in the list box, a beep occurs if the mouse is in the first half of the item. A similar technique can be used to detect 揾ot?regions in an owner-draw list box:procedure TForm1.FormCreate(Sender: TObject);begin
  with ListBox1 do
  begin
    Items.Add('Hello');
    Items.Add('New');
    Items.Add('World');
  end;
end;procedure TForm1.ListBox1MouseUp (Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);var
  ListBoxItem: TRect;
begin
  if Button = mbLeft then
  begin
    ListBoxItem := ListBox1.ItemRect(ListBox1.ItemIndex);
    if (Y > ListBoxItem.Top) and 
       (Y < ListBoxItem.Bottom) and 
       (X > ListBoxItem.Left) and 
       (X < (ListBoxItem.Left + ListBoxItem.Right) div 2) then
      Beep;
  end; end;
还有X,Y我知道是坐标,可是(X < (ListBoxItem.Left + ListBoxItem.Right) div 2)为什么要这样子写呢?(X > ListBoxItem.Right)不好吗?