private void treeFriend_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
{
if (treeFriend.SelectedNode.Text != "我的好友")
{
Thread thread = new Thread(new ParameterizedThreadStart(friendShow));
thread.IsBackground = true;
thread.SetApartmentState( ApartmentState.STA);
thread.Start(treeFriend.SelectedNode.Text);
}
}
private void friendShow(object o)
{
string str = (string)o;
Chat mychat = new Chat();
mychat.Text = str;
mychat.ShowDialog();
}
遍历每一个子节点,判断子节点显示的文字是不是你要寻找的,是的话,选中它,KO