public SetParentChildForm(decimal mapid) { InitializeComponent(); DataTable roottable = MapDBClass.GetTifInformation(mapid); //查询影像图结构 PhotoList = MapDBClass.GetPhotoList(); ParentChildTable = MapDBClass.GetChildList(); treeView1.Nodes.Clear(); if (roottable != null && roottable.Rows.Count == 1) { TreeNode rootnode = new TreeNode(roottable.Rows[0]["Name"].ToString()) { Tag = roottable.Rows[0]["PhotoId"] }; treeView1.Nodes.Add(rootnode); AddNode(rootnode); treeView1.SelectedNode = rootnode; } }