比较简单的做法,增加一个子节点提示.然后开线程请求真实的子节点,完毕后替换提示节点。
代码如下
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication11
{
public partial class Form1 : Form
{
//用于控制线程的方法
public class ThreadStartInfo
{
public TreeNode node=null;
//模拟载入数据
public void LoadNode()
{
System.Threading.Thread.Sleep(5000);
string[] str = new string[] { "jinjazz", "csdn" ,"sina","google","yahoo","nba","fifa"};
this.AddNode(node, str);
}
delegate void dAddNode(TreeNode node, str