Why does the text property overridden in user control is not showing at design time

后端 未结 2 2086
Happy的楠姐
Happy的楠姐 2021-02-13 14:04

I have a usercontrol which overrides the property Text. But this property is not shown at design time.

If I rename it to caption or value it is shown in properties at de

2条回答
  •  旧时难觅i
    2021-02-13 14:42

    The Text property is defined as:

    [Bindable(false), EditorBrowsable(EditorBrowsableState.Never), Browsable(false),
     DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
    

    Meaning, you can't browse it in the property window; you need to override the property attributes defined here (which I don't know if that will work as expected) or just set the property name to something else.

    HTH.

提交回复
热议问题