How can “default” values in overridden WinForm controls be prevented?

前端 未结 3 1798
挽巷
挽巷 2021-01-14 11:45

I\'m trying to learn and grasp what and how C# does things. I\'m historically a Visual Foxpro (VFP) developer, and somewhat spoiled at the years of visual inheritance by cr

3条回答
  •  醉酒成梦
    2021-01-14 11:55

    Instead of using the "ReadOnlyAttribute", try using the "DefaultValueAttribute" instead. If I remember correctly, the designer shouldn't create code to set the property if the current value matches the value stored in the "DefaultValueAttribute".

提交回复
热议问题