virtual public void Append(IDriverWidget child) { WinFormsControl c = child as WinFormsControl; if (c == null || c.Control == null) { return; } Control.Controls.Add(c.Control); }
virtual public void Detach(IDriverWidget child) { WinFormsControl c = child as WinFormsControl; if (c == null || c.Control == null) { return; } if (Control.Contains(c.Control)) { Control.Controls.Remove(c.Control); } }
public override void Append(IDriverWidget child) { //appending to tabs does not append a control child in normal order, //but appends a tab page to the tab control if (child != null) { WinFormsTabPage tp = child as WinFormsTabPage; if (tp == null) { throw new Exception("Only object of type TabPage can be appended to Tabs"); } TabControl.TabPages.Add(tp.TabPage); } }