I wrote a custom collection editor for a WinForms control. Its core code looks like this:
internal class MyCollectionEditor : CollectionEditor
{
public MyCollectionEditor(Type type) : base(type) { }
protected override System.ComponentModel.Design.CollectionEditor.CollectionForm CreateCollectionForm()
{
System.ComponentModel.Design.CollectionEditor.CollectionForm myForm = base.CreateCollectionForm();
#region Adjust the property grid
PropertyGrid myPropGrid = GetPropertyGrid(myForm);
if (myPropGrid != null)
{
myPropGrid.CommandsVisibleIfAvailable = true;
myPropGrid.HelpVisible = true;
myPropGrid.PropertySort = PropertySort.CategorizedAlphabetical;
}
#endregion
return myForm;
}
}
I need to set a custom size and location for the collection editor form, but I could not find a way to do that. It seems the collection editor form is always positioned by VS to its default location. Is there a way to do what I need?
CollectionEditor
s: How do you create a custom collection editor form for use with the property grid? – Garnish