shellproperties OnRename property
Return to Introduction  Previous page  Next page
Applies to
dcShellProperties component.  

Declaration
type  
  TdcContextMenuEvent = procedure(Sender: TObject; FileName: Stringof object;  
 
property OnRename: TdcContextMenuEvent;  

Description
The OnRename event occurs when user selects the "Rename" item in the context menu. The FileName parameter determines the file name which should be renamed.  
 
tip "Rename" menu item will be available in context menu only if moCanRename flag of MenuOptions property is True.  
 
Shell objects could not be renamed automatically. You must write the event handler to perform this operation.  

Example
procedure TForm1.dcShellPropertiesRename(Sender: TObject; FileName: String);  
begin  
  if ListView1.Selected <> nil then   
    ListView1.Selected.EditCaption;  
end;  

See also
MenuOptions property; OnDelete event;  
ShowContextMenu and ShowContextMenuByFile methods.