treeview添加
TreeNode node = new TreeNode();
node.Name = "区域";
node.Text = "区域";
node.ContextMenuStrip = cmsquyu;
TreeNode childnode = new TreeNode();
childnode.Name = "设备1";
childnode.Tag = source.Common.userid[0];
childnode.Text = "设备1";
childnode.ContextMenuStrip = cmsshebei;
Panel pel = drawPanel(1);
pel.Size = new Size(panel2.Size.Width / 2, panel2.Size.Height / 2);
pel.Location = new Point(0, 0);
panel2.Controls.Add(pel);
TreeNode smallchildnode = new TreeNode();
smallchildnode.Name = "通道1";
smallchildnode.Tag = 1 ;
smallchildnode.Text = "通道1";
smallchildnode.ForeColor = Color.Red;
smallchildnode.ContextMenuStrip = cmstongdao;
childnode.Nodes.Add(smallchildnode);