代码如下
private void treeView1_AfterExpand(object sender, TreeViewEventArgs e)
{
if (treeView1???)
{
button1.Visible = true;
button2.Visible = true;
button3.Visible = true;
button4.Visible = true;
label2.Visible = true;
label3.Visible = true;
label4.Visible = true;
label5.Visible = true; this.pictureBox1.Image = global::WindowsApplication1.Properties.Resources.studentiformation;
this.pictureBox1.Location = new System.Drawing.Point(214, 172);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(136, 138);
this.pictureBox1.TabIndex = 1;
this.pictureBox1.TabStop = false;
}
假如我要做展开后加载这些图片呀 还有设置可见性啊 但是我不知道if里面怎么获得展开节点的索引
请高手指点
private void treeView1_AfterExpand(object sender, TreeViewEventArgs e)
{
if (treeView1???)
{
button1.Visible = true;
button2.Visible = true;
button3.Visible = true;
button4.Visible = true;
label2.Visible = true;
label3.Visible = true;
label4.Visible = true;
label5.Visible = true; this.pictureBox1.Image = global::WindowsApplication1.Properties.Resources.studentiformation;
this.pictureBox1.Location = new System.Drawing.Point(214, 172);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(136, 138);
this.pictureBox1.TabIndex = 1;
this.pictureBox1.TabStop = false;
}
假如我要做展开后加载这些图片呀 还有设置可见性啊 但是我不知道if里面怎么获得展开节点的索引
请高手指点
foreach(TreeNode node in treeView2.Nodes)
{
if (node.IsExpanded)
{
Console.WriteLine(node.Text);
}
}