Ver Mensaje Individual
  #3  
Antiguo 27-11-2013
Avatar de nlsgarcia
[nlsgarcia] nlsgarcia is offline
Miembro Premium
 
Registrado: feb 2007
Ubicación: Caracas, Venezuela
Posts: 2.206
Reputación: 23
nlsgarcia Tiene un aura espectacularnlsgarcia Tiene un aura espectacular
Toni-2006,

Cita:
Empezado por Toni-2006
...no se hacer que aparezca el PopUpMenu encima del elemento seleccionado y no en la posición donde esté el cursor...
Esta es una variante del código sugerido en el Msg #2:
Código Delphi [-]
procedure TForm1.FileListBox1MouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
   P : TPoint;
   SI: Integer;
begin
   SI :=  SelectedItemIndex(FileListBox1);
   if (ssRight in Shift) and (SI <> -1) then
   begin
      P.X:= FileListBox1.Width - FileListBox1.Left + 40;
      // Popup Menu Sobre el Item Seleccionado
      P.Y:= FileListBox1.Top + SI * FileListBox1.ItemHeight - 50;
      P  := ClientToScreen(P);
      PopupMenu1.Popup(P.X, P.Y);
   end;
end;
El código anterior muestra un TPopupMenu sobre un Item seleccionado en un TFileListBox como se muestra en la siguiente imagen:



Espero sea útil

Nelson.
Responder Con Cita