DefaultValueAttribute

DefaultValueAttribute

System.ComponentModel (system.dll) sealed class

This attribute decorates a property to indicate its default value. The VS.NET designer will display a property that is set to its default value using a plain style, whereas non-default values will be displayed in bold.

You should ensure that the Value of the attribute matches the initial value assigned to the property, as code generators may choose not to persist default properties.

 public sealed class  DefaultValueAttribute  : Attribute {  // Public Constructors  public  DefaultValueAttribute  (bool  value  );    public  DefaultValueAttribute  (byte  value  );    public  DefaultValueAttribute  (char  value  );    public  DefaultValueAttribute  (double  value  );    public  DefaultValueAttribute  (short  value  );    public  DefaultValueAttribute  (int  value  );    public  DefaultValueAttribute  (long  value  );    public  DefaultValueAttribute  (object  value  );    public  DefaultValueAttribute  (float  value  );    public  DefaultValueAttribute  (string  value  );    public  DefaultValueAttribute  (Type  type  , string  value  );  // Public Instance Properties  public object  Value  {get; }  // Public Instance Methods  public override bool  Equals  (object  obj  );  // overrides Attribute  public override int  GetHashCode  ();  // overrides Attribute  } 

Hierarchy

System.Object System.Attribute DefaultValueAttribute

Valid On

All



. Net Windows Forms in a Nutshell
.NET Windows Forms in a Nutshell
ISBN: 0596003382
EAN: 2147483647
Year: 2002
Pages: 794

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net