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

前端 未结 9 1168
清歌不尽
清歌不尽 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:42

    A visual designer typically displays in the Properties window those members that either have no browsable attribute or are marked with the BrowsableAttribute constructor's browsable parameter set to true. These members can be modified at design time. Members marked with the BrowsableAttribute constructor's browsable parameter set to false are not appropriate for design-time editing and therefore are not displayed in a visual designer. The default is true.

    so, the answer is you never have to, as it is done by default.

提交回复
热议问题