Vote count: 0
If I comment out CreateInstance
, then the "Design" is showing, but if I override it it is not showing. How can I make it shown?
No override:
Override:
Code:
public class MyEditor : CollectionEditor
{
public MyEditor(Type type) : base(type)
{
}
protected override Type[] CreateNewItemTypes()
{
return new[]
{
typeof(TabPage) //TabPage is subclass of "Panel".
};
}
protected override object CreateInstance(Type itemType)
{
var item = new TabPage(true);
return item;
}
}
Also, the title of the collection editor window is "Object Collection Editor", instead of my collection's name such as "TabPage Collection Editor". Not a big problem, but I would like to fix this, if possible.
asked 15 secs ago
How to show the "Design" category in a custom CollectionEditor when overriding CreateInstance()?
Aucun commentaire:
Enregistrer un commentaire