//再構築に先立ってコントロールの親子関係を破棄しておく。その方が何かと紛れがない public void ClearControlTree() { if (_intermediateContainer != null) { _intermediateContainer.Controls.Clear(); } if (_next != null) { _next.ClearControlTree(); } if (!this.IsLeaf) { _childList.ClearControlTree(); } }
//親子関係の構築 private void Rebuild() { _rootList.ClearControlTree(); _rootList.FirstNode.BuildControlTree(_rootList.HostingControl); }