I'm trying to override the View property in a derived class from Listview:
public class CustListview : System.Windows.Forms.ListView
{
private CustView mView = new CustView();
public enum CustView : int
{
Tile = 0,
Details = 1,
List = 2,
}
public new CustView View
{
get
{
return mView;
}
set
{
mView = value;
}
}
}
In code it all works well but in VS designer, when I add a CustListview to a form, the View property causes an error
Object reference not set to an instance of an object
in the Properties window.
When I override any other property this way like Alignment or TabStop it works as expected and I see a dropdownlist with the 3 items Tile, Details and list.
Why isn't it working with the View property?