FolderItem.Count

From Xojo Documentation

Read-Only Property (As Integer )
IntegerValue = aFolderItem.Count

Supported for all project types and targets.

The number of items in the FolderItem if it is a directory/folder.

Notes

Avoid calling this function several times as it is costly in processing time and will have poor performance.

Especially avoid calling it repeatedly in a loop. Instead, get its value once and store it in a variable for further use.

Example

Var f As New FolderItem
f = FolderItem.ShowSelectFolderDialog
MessageBox(f.Count.ToString)