private void btOK_Click(object sender, System.EventArgs e) { if (listBox1.SelectedIndex >= 0) { Type tp = (Type)listBox1.Items[listBox1.SelectedIndex]; objRet = (DrawingItem)Activator.CreateInstance(tp); objRet.ResetDefaultProperties(); Close(); } }