public void setObject(ISelectable o) { objectTypeLabel.Text = o.GetName(); if (currentEditor != null) HideProperties(); this.tableLayoutPanel1.Controls.Remove(currentEditor); currentEditor = o.GetEditorControl(); ((ManageRobot)this.FindForm()).DeleteCurrentSel = o.Delete; if (currentEditor != null) { currentEditor.Dock = DockStyle.Fill; this.tableLayoutPanel1.Controls.Add(currentEditor,0,0); if (currentEditor is AttachmentProperties) { button1.Visible = true; } else { button1.Visible = false; } } }