日期:2014-05-17 浏览次数:21070 次
/// <summary>
/// 检查指定节点下是否存在被选中的节点
/// </summary>
/// <param name="tn"></param>
/// <returns></returns>
private bool IsItemHasChecked(TreeNode tn)
{
if (tn.Nodes.Count > 0)
{
for (int i = 0; i < tn.Nodes.Count; i++)
{
if (tn.Nodes[i].Checked == true)
return true;
else
IsItemHasChecked(tn.Nodes[i]):
}
}
return false;
}
/// 检查指定节点下是否存在被选中的节点
/// </summary>
/// <param name="tn"></param>
/// <returns></returns>
private bool IsItemHasChecked(TreeNode tn)
{
for (int i = 0; i < tn.Nodes.Count; i++)
{
if (tn.Nodes[i].Checked == true)
return true;
else
{
if (IsItemHasChecked(tn.Nodes[i]) == true)
&nbs