简体   繁体   中英

Why is my property readonly in winforms editor?

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; }

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM