Hot to...

  • Thread starter Thread starter Jacek Jurkowski
  • Start date Start date
J

Jacek Jurkowski

.... set default Padding property value using DefaultValue attribute?
Or there is another way?
 
Hi,

Is it this what you are looking for:

private string _mystring = "mydefvalue";

[DefaultValue(typeof(string), "mydefvalue")]
public string MyProp
{
get{return _mystring;}
set{_mystring = value;}
}

Regards,
Josip Habjan, Croatia
URL: http://www.habjansoftware.com
 
Not. I'm lookong a devault value for
padding property

[DefaultValue(What? "3;3;3;3"? No. So what?)]
public Padding Padding
{
get{...}
set{...}
}
 
Did you set variable that you use in this property to same value as in
default value attribute ?
Both ... and variable and default value attribute must have same default
value...

Regards,
Josip Habjan, Croatia
URL: http://www.habjansoftware.com


Jacek Jurkowski said:
Unfortunatelly it doesn't work :-(
Then it would go something like this:
[DefaultValue(typeof(Padding), "3;3;3;3")]
 
Back
Top