以下是引用狐狸爸爸在2011-8-26 12:09:00的发言:
If Lsj.Contains(e.Node.Text) = False Then
Lsj.Add(e.Node.Text)
End If
e.Form.Controls("TextBox2").value =Nothing
For Each s As String In Lsj
e.Form.Controls("TextBox2").value += "," & s
Next
If Lsj.count>3 Then
For Each nd As WinForm.TreeNode In e.Sender.AllNodes
If nd.Text = Lsj(0) Then
nd.BackColor = Color.White
Lsj.RemoveAt(0)
If lsJ.Count =0 Then
Exit For
End If
End If
Next
End If
For Each nd As WinForm.TreeNode In e.Sender.AllNodes
For Each s As String In Lsj
If nd.Text = s Then
nd.BackColor = Color.LightGray
End If
Next
Next
多谢先!
这个是不报错了,只是有点不明:我设置了If Lsj.count>3 Then才执行If...End if里面的代码呀,为何里面还须
If lsJ.Count =0 Then
Exit For
End If 呢?
且虽不报错,但有时结果不对:见图,TextBox2显示Lsj有[数码产品,电脑,电脑配件,机箱,主板]5个值,但标记只有[主板]

此主题相关图片如下:00.gif
