When do we need to use [Browsable(true)]?

前端 未结 9 1169
清歌不尽
清歌不尽 2021-01-01 13:06

When do we need to use [Browsable(true)]?

EDIT (by SLaks): He\'s asking (I assume) why one would need to pass true as the

9条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-01 13:43

    The types and attributes in ComponentModel are not specifically tied to any particular designer. Although I don't know of any specific scenario that you would need to "opt in" to being designer-browsable, I suppose it's conceivable that you could have some component designer that would assume browsable(false).

    I suppose you could also override a virtual property that specified browsable(false) and apply browsable(true) in the overridden member.

提交回复
热议问题