It may be a tad more complicated, but it's really easy once you understand it ... it's really no big deal.
Yes, the DefaultValue attribute goes just before the properrty ... how else will the compiler know which property you are referring to? <g>
~~Bonnie
>Hi Bonnie,
>
>>
>>public class MyTextBox : System.Windows.Forms.TextBox
>>{
>> public MyTextBox()
>> {
>> this.BackColor = Color.Firebrick; ;
>> }
>> [DefaultValue(typeof(System.Drawing.Color), "Firebrick")]
>> public override System.Drawing.Color BackColor
>> {
>> get { return base.BackColor; }
>> set { base.BackColor= value; }
>> }
>>}
>>
>
>This gets more complicated by the minute! It's at times like these that I can't help thinking of how simple it was to achieve the same thing in VFP. The thing I find most frustrating is that you have to declare the default color twice, once in the constructor, and once as a default value (to please the designer). Still, that's progress I suppose :-(
>
>Must the DefaultValue directive always occur just before the override method for the corresponding property?
>
>TIA
>Alan