I have a class that desccends from ListviewItem.
When I create an instance of this class, I assign to the instance some properties inherited from its ancestor, ListViewItem.
However, the EnsureVisible property is problematic.
If I do this:
base.EnsureVisible = true;
…I get, “Cannot assign to ‘EnsureVisible’ because it is a ‘method group'”
..and if I do this:
base.EnsureVisible(true);
…I get, “No overload for method ‘EnsureVisible’ takes 1 arguments”
The name of the property makes it sound useful, but how can I use it?
The problem you’re seeing is that
EnsureVisibleis a no-argument method and not a property. It has the following signatureYou can’t assign a value to it. Calling the method itself forces the item to become visible (or at least requests it)