Ver Mensaje Individual
  #4  
Antiguo 18-04-2012
Avatar de roman
roman roman is offline
Moderador
 
Registrado: may 2003
Ubicación: Ciudad de México
Posts: 20.269
Reputación: 10
roman Es un diamante en brutoroman Es un diamante en brutoroman Es un diamante en bruto
Hay una forma de obtener el subitem sobre el que se da clic:

Código Delphi [-]
uses CommCtrl;

procedure TForm1.ListViewMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
  Item: TListItem;
  Info: TLVHitTestInfo;
  Index: Integer;

begin
  Info.pt := Point(X, Y);
  Index := ListView_SubItemHitTest(ListView.Handle, @Info);

  if Index <> -1 then
  begin
    Item := ListView.Items[Index];

    if Info.iSubItem = 0
      then ShowMessage(Item.Caption)
      else ShowMessage(Item.SubItems[Info.iSubItem - 1]);
  end
  else
    ShowMessage('nowhere');
end;

// Saludos
Responder Con Cita