1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
dossierDefaut = L"H:\\proimager\\Albums\\Portfolio";
treeView1->Nodes->Clear();
int i=0;
for each(DriveInfo^ disque in DriveInfo::GetDrives())
{
if(disque->IsReady)
{
treeView1->Nodes->Add(disque->Name);
Explorer(treeView1->Nodes[i++]);
}
}
if(Directory::Exists(dossierDefaut))
{
array<String^>^ dNd = dossierDefaut->Split('\\');
for(int i=0;i<dNd->Length;i++)
{
// est ce que dNd[i] fini par le caractère ":" ?
if(dNd[i]->EndsWith(":"))
{
for each(TreeNode^ t in treeView1->Nodes)
{
if(t->Text==dNd[i] + L"\\")
{
nd = t;
Explorer(t);
t->Expand();
break;
}
}
}
else
{
for each(TreeNode^ t in nd->Nodes)
{
if(t->Text==dNd[i])
{
nd = t;
Explorer(t);
t->Expand();
break;
}
}
}
}
}
else
nd = treeView1->Nodes[0];
this->treeView1->SelectedNode = nd; |
Partager