{
OnPopup example
The following code enables the Copy item from the pop-up menu if the edit control 
has a nonempty selection.
} 
procedure TForm1.PopupMenu1Popup(Sender: TObject);
begin
  Copy1.Enabled := Edit1.SelLength > 0;
end; 
