[英]what code is make to treeview node expand
如果要擴展所有節點,則可以使用TreeView.ExpandAll()方法
private void Form1_Load(object sender, EventArgs e)
{
foreach (DriveInfo drv in DriveInfo.GetDrives())
{
if (drv.IsReady)
{
TreeNode t2 = new TreeNode();
t2.Text = drv.Name;
t2.Nodes.Add("make this not empty to show a result");
treeView.Nodes.Add(t2);
treeView.ExpandAll();
}
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.