if listbox1.items[listbox1.itemindex-1]='你的值' then

解决方案 »

  1.   

    var
      lindex: Integer;
    begin
      for lindex := 0 to ListBox1.Items.Count-1 do
      begin
        if ListBox1.Selected[lindex] then
        begin
          if lindex <> 0 then
            if ListBox1.Items[lindex-1] = yourvalue then
            begin
              //前一个的处理
            end;
          if lindex <> ListBox1.Items.Count-1 then
            if ListBox.Items[lindex+1] = yourvalue then
            begin
              //后一个的处理
            end;
        end;
      end;
    end;