How does one have the C# designer know the default property for a Padding or other object/struct in C#

后端 未结 2 1102
情歌与酒
情歌与酒 2021-02-15 03:42

How does one tell the designer the default value of a Property when it is not one of the types supported by DefaultValue()? For instance, a Padding, or

2条回答
  •  春和景丽
    2021-02-15 04:20

    Try this:

    [DefaultValue( typeof( Padding ), "2, 2, 2, 2" )]
    public Padding LabelPadding
    {
        get { return _labelPadding; }
        set { _labelPadding = value; }
    }
    

提交回复
热议问题