我创建了一个DesignPanel对象,但是想给他赋初始化值,但是ToolboxItem内用的是typeof的方式创建的,请问各位大神怎么写类似这样的代码 new ToolboxItem(typeof(DesignPanel){name:“123”});
ToolboxItem toolPanel = new ToolboxItem(typeof(DesignPanel));
toolPanel.DisplayName = (item as RFWindos.Model.Encoder).name;
toolPanel.Bitmap = new System.Drawing.Bitmap(16, 16);
listBox1.Items.Add(toolPanel);