private static void SetTreeViewIcon(TreeView tv, NodeType firstType, NodeType secondType, NodeType thirdType)
{
TreeNode tnRoot = tv.Nodes[0];
tnRoot.ImageIndex = 0;
foreach (TreeNode tnFirst in tnRoot.Nodes)
{
tnFirst.ImageIndex = tnFirst.SelectedImageIndex = (int)firstType;
foreach (TreeNode tnSecond in tnFirst.Nodes)
{
tnSecond.ImageIndex = tnSecond.SelectedImageIndex = (int)secondType;
foreach (TreeNode tnThird in tnSecond.Nodes)
{
tnThird.ImageIndex = tnThird.SelectedImageIndex = (int)thirdType;
}
}
}
}
posted on 2008-09-04 20:43
天书 阅读(505)
评论(0) 编辑 收藏 引用