private void btnAdd_Click(object sender, EventArgs e) { var frmSelectType = new FormSelectType(typeof(T)); if (frmSelectType.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Type type = frmSelectType.SelectedType; try { var obj = (T)Activator.CreateInstance(type); this.lstMember.Items.Add(obj); this.list.Add(obj); this.propertyGrid.SelectedObject = obj; } catch (Exception ex) { Debug.WriteLine(ex.ToString()); MessageBox.Show(ex.Message, string.Format("Error when Adding instance of [{0}]!", type.Name)); } } }