开发者

Why properties you add to a custom .NET user control appear bold in propertygrid?

开发者 https://www.devze.com 2023-03-12 18:41 出处:网络
Usually, only modified control properties are bold. But in this scenario, I\'ve created a custom user control and add开发者_运维百科ed a public property to it. When I add it to any container and open

Usually, only modified control properties are bold.

But in this scenario, I've created a custom user control and add开发者_运维百科ed a public property to it. When I add it to any container and open the properties window, all properties I've added appear also bold - despite the default value.

Why does this happen and how to prevent it?


Try to add the DefaultValueAttribute to the properties and set it to the value that you don't want to appear bold.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号