/// <summary> /// 刷新树结构 /// </summary> public void RefreshCode() { this.tvInfo.Nodes.Clear(); //加载树 string strSqls = "select * from tb_gaoweiproject order by id"; ds = dg.GetDataSet(strSqls); dt = ds.Tables[0]; if (dt.Rows.Count > 0) { //绑定树 BindRoot(cmsProject, cmscontent, value); //tvInfo.ExpandAll(); } //设置TreeView样式 tvInfo.HideSelection = false; //tvInfo.DrawMode = TreeViewDrawMode.OwnerDrawText; this.tvInfo.DrawNode += new DrawTreeNodeEventHandler(tvInfo_DrawNode); }