Directory delphi目录列表框获取所选目录名

Directory delphi目录列表框获取所选目录名,directory,Directory,我在delphi中使用dirListBox。我无法获取所选目录的子目录名。它给我的是根目录名。如何获取所选目录名 dirListBox.Directory返回父目录,而不是子目录 fMain.eProject.Text:=fProject.dirlistBox.Items[fProject.dirListBox.ItemIndex]; fMain.ePath.Text:=fProject.dirListBox.GetItemPath(fProject.dirListBox.ItemIndex

我在delphi中使用dirListBox。我无法获取所选目录的子目录名。它给我的是根目录名。如何获取所选目录名


dirListBox.Directory返回父目录,而不是子目录

 fMain.eProject.Text:=fProject.dirlistBox.Items[fProject.dirListBox.ItemIndex];
 fMain.ePath.Text:=fProject.dirListBox.GetItemPath(fProject.dirListBox.ItemIndex);
获得正确名称的唯一方法是使用itemindex。 单击或将光标移动到目录时,itemindex将更新

 fMain.eProject.Text:=fProject.dirlistBox.Items[fProject.dirListBox.ItemIndex];
 fMain.ePath.Text:=fProject.dirListBox.GetItemPath(fProject.dirListBox.ItemIndex);