public override void Initialize(IComponent component) { base.Initialize(component); // this.m_ExpandableNodeCollectionPanel = base.Component as ExpandableNodeCollectionPanel; if (this.m_ExpandableNodeCollectionPanel == null) { this.DisplayError(new ArgumentException("ExpandableNodeCollectionPanel == null")); return; } }
private void AddExpandableNodeCollectionPanel3(object sender, EventArgs ea) { IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); if (host != null) { ExpandableNodeCollectionPanel expandablePanel = host.CreateComponent(typeof(ExpandableNodeCollectionPanel)) as ExpandableNodeCollectionPanel; expandablePanel.Text = expandablePanel.Name; expandablePanel.Size = new Size(100, 100); expandablePanel.ShowTreeNodeButton = true; this.m_ExpandableNodeCollectionPanel.ExpandableNodePanels.Add(expandablePanel); } }