public Label AddProperty(string name, Type editorType, bool isReadOnly) { Label label = new Label(); label.AutoSize = false; label.Text = name; label.ForeColor = Color.LightGray; label.TextAlign = ContentAlignment.MiddleLeft; label.Location = new Point(0, _location); propertiesSplitContainer.Panel1.Controls.Add(label); Control ctrl = null; if (editorType == null) { ctrl = new Panel(); ctrl.Height = 20; ctrl.BackColor = Color.Red; } else { DesignerPropertyEditor editor = (DesignerPropertyEditor)editorType.InvokeMember(string.Empty, BindingFlags.CreateInstance, null, null, new object[0]); if (isReadOnly) { editor.ReadOnly(); } ctrl = editor; } label.Height = ctrl.Height; label.Tag = ctrl; ctrl.Location = new Point(0, _location); propertiesSplitContainer.Panel2.Controls.Add(ctrl); _location += ctrl.Height + _padding; propertiesSplitContainer.Height = _location - _padding; return(label); }