Skip to main content

TcxShellFolder.IsLink Property

Identifies if the shell item is a link to a file or folder.

Declaration

property IsLink: Boolean read;

Property Value

Type Description
Boolean

True, if the shell item is a link; otherwise, False.

Remarks

Use IsFolder, IsFolderLink, IsLink, IsZip, and IsZipFolderLink properties to identify the shell item type.

Code Examples

TdxShellListView

The following code example displays the name and type of the first selected shell item in the application form caption:

var
  AFolder: TcxShellFolder;
begin
  if ((dxShellListView1.FolderCount = 0) or (dxShellListView1.SelectedItemCount = 0)) then Exit;
  AFolder := dxShellListView1.Folders[dxShellListView1.SelectedItems[0].Index];
  Caption := 'The ' + AFolder.DisplayName;
  if AFolder.IsFolder then
  begin
    Caption := Caption + ' folder is selected';
    if AFolder.SubFolders then
      Caption := Caption + '; includes nested folders';
  end
  else if((AFolder.IsLink) or (AFolder.IsFolderLink) or (AFolder.IsZipFolderLink)) then
    Caption := Caption + ' shell item link is selected'
  else
    Caption := Caption + ' file is selected';
end;

TdxShellTreeView

The following code example displays the name and type of the first selected shell item in the application form caption:

var
  AFolder: TcxShellFolder;
begin
  if ((dxShellTreeView1.FolderCount = 0) or (dxShellTreeView1.SelectionCount = 0)) then Exit;
  AFolder := dxShellTreeView1.Folders[dxShellTreeView1.Selections[0].Index];
  Caption := 'The ' + AFolder.DisplayName;
  if AFolder.IsFolder then
  begin
    Caption := Caption + ' folder is selected';
    if AFolder.SubFolders then
      Caption := Caption + '; includes nested folders';
  end
  else if((AFolder.IsLink) or (AFolder.IsFolderLink) or (AFolder.IsZipFolderLink)) then
    Caption := Caption + ' shell item link is selected'
  else
    Caption := Caption + ' file is selected';
end;
See Also