private void SetTreeImagesInternal(myTreeNode treeNode)
{
int index = 0;
if (treeNode.TexInd != -1)
{
TPFTexInfo tex = LoadedTexes[treeNode.TexInd];
index = tex.ThumbInd;
}
else
index = 0;
treeNode.ImageIndex = index;
treeNode.SelectedImageIndex = index;
// Print each node recursively.
foreach (myTreeNode tn in treeNode.Nodes)
SetTreeImagesInternal(tn);
}