void Update_UC_TreeNavBar(DevExpress.XtraNavBar.NavBarGroup navBarGroup, TreeNodeButton pMenuBarTreeNode) { BarGroup wBarGroup = (BarGroup)navBarGroup.Tag; wBarGroup.MenuBarTree.Add(pMenuBarTreeNode); UC_TreeNavBar treeList = (UC_TreeNavBar)((System.Windows.Forms.Control)(navBarGroup.ControlContainer)).Controls[0]; //treeList = navBarGroup treeList.Populate(wBarGroup.MenuBarTree, this.IsOnDesignMode); }
void Cretate_UC_TreeNavBar(DevExpress.XtraNavBar.NavBarGroup navBarGroup) { BarGroup wBarGroup = (BarGroup)navBarGroup.Tag; NavBarGroupControlContainer navBarGroupControlContainer = new NavBarGroupControlContainer(); navBarGroupControlContainer.SuspendLayout(); this.Controls.Add(navBarGroupControlContainer); UC_TreeNavBar treeList = new UC_TreeNavBar(); this.SuspendLayout(); navBarGroup.GroupStyle = NavBarGroupStyle.ControlContainer; navBarGroupControlContainer.Controls.Add(treeList); navBarGroupControlContainer.Name = "navBarGroupControlContainer" + treeCount; navBarGroupControlContainer.Size = new System.Drawing.Size(176, 243); //navBarGroupControlContainer.TabIndex = treeCount; navBarGroup.ControlContainer = navBarGroupControlContainer; treeList.Populate(wBarGroup.MenuBarTree, this.IsOnDesignMode); treeList.Dock = System.Windows.Forms.DockStyle.Fill; treeList.Location = new System.Drawing.Point(0, 0); treeList.Name = string.Concat("treeList", treeCount); treeList.TabIndex = treeCount; treeList.Tag = wBarGroup.MenuBarTree; treeList.OnNodeClick += new OnNodeClickHandler(treeList_OnNodeClick); treeList.OnTreeViewClick += new EventHandler(treeList_OnTreeViewClick); SetTreeDesignMode(treeList); treeCount++; navBarGroupControlContainer.ResumeLayout(false); this.ResumeLayout(false); }