method ExShellFolder.InvokeRename ()
Performs the rename operation

TypeDescription
Call the InvokeRename method to call renaming an folder or a file, at run-time. The CanRename property should be set on True, before performing the InvokeRename method, else it has no effect. Use the SelectedFolder property to get the selected folder in the control. The rename operation starts only if the selected shell object supports renaming. For instance, if you try to rename the My Computer folder, it is not allowed, since it doesn't support renaming. The control is focused, when InvokeRename method is called. Use the InvokeCommand method to execute a command from the object's context menu.

The following VB sample starts renaming the selected folder, when the user presses the F2 key:

Private Sub ExFolderView1_KeyDown(KeyCode As Integer, Shift As Integer)
    If (KeyCode = vbKeyF2) Then
        ExFolderView1.SelectedFolder.InvokeRename
    End If
End Sub