Why is my property readonly in winforms editor?

58 views Asked by At

My class A inherits a class B that inherits AxHost.

My property is shown as readonly with no attributes set that would enforce this behaviour.

public int MyProperty { get; set; }
1

There are 1 answers

0
Otterprinz On

My property was missing a DispId Attribute.

[System.Runtime.InteropServices.DispId(96859268)]
public int MyProperty { get; set; }

DispID must be unique across interfaces?

Further questions: In my example, Class B does have some Properties tagged with DispId and some without, and those without are not affected by being readonly. If someone has an explanation for this, please share it.