C#treeview不显示如题 谢谢了
privatevoidForm1_Load(objectsender,EventArgse){stringpath=@"c:\DocumentandSettings\Ad...
private void Form1_Load(object sender,EventArgs e) { string path = @"c:\Document and Settings\Administrator\funshion"; listnodes(path); } private void listnodes(string path) { string[] paths = Directory.GetDirectories(path); foreach (string p in paths) { treeView1.Nodes.Add(p); listnodes(p); } } private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) { string path = treeView1.SelectedNode.Text; string[] files = Directory.GetFiles(path); listView1.Items.Clear(); listView1.View = View.List; foreach (string file in files) { listView1.Items.Add(file); } } 程序是这样的,调试时没有错误,但是窗体上没有任何显示,请大家帮帮忙。
展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询