Ver Mensaje Individual
  #4  
Antiguo 03-04-2022
Avatar de ecfisa
ecfisa ecfisa is offline
Moderador
 
Registrado: dic 2005
Ubicación: Tres Arroyos, Argentina
Posts: 10.508
Reputación: 36
ecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to behold
Hola.

Otra opción para capturar el texto del ítem ante el click del ratón:
Código Delphi [-]
...
uses CommCtrl;

function GetListViewSubItem( LView: TListView ): string;
var
  Item: TListItem;
  Info: TLVHitTestInfo;
  Inx: Integer;
begin
  Info.pt := LView.ScreenToClient( Mouse.CursorPos );
  Inx := ListView_SubItemHitTest( LView.Handle, @Info );
  Result := '';
  if Inx <> -1 then
  begin
    Item:= LView.Items[Inx];
    if Info.iSubItem = 0 then
      Result := Item.Caption
    else
      Result:= Item.SubItems[Info.iSubItem-1];
  end;
end;
Ejemplo de uso:
Código Delphi [-]
procedure TForm1.ListView1Click( Sender: TObject );
begin
  Caption := GetListViewSubItem( ListView1 );
end;

Saludos
__________________
Daniel Didriksen

Guía de estilo - Uso de las etiquetas - La otra guía de estilo ....
Responder Con Cita