From: JohnH on
The following class allows you to use an enumerate value as the default value directly:

Public Class EnumDefaultValueAttribute
Inherits DefaultValueAttribute

Public Sub New(ByVal value As Object)
MyBase.New(value.GetType, value.ToString)
End Sub
End Class

Simply use EnumDefaultValueAttribute instead of DefaultValueAttribute and pass in the required enumerated value.

From http://www.developmentnow.com/g/38_2009_5_0_0_1053869/DefaultValue-attribute-for-a-property-with-an-enum-type.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com/g/
From: Armin Zingler on
JohnH schrieb:
> The following class allows you to use an enumerate value as the default value directly:

Yeah, he's been waiting for it so long, so he must be so glad now.
http://en.wikipedia.org/wiki/Calendar_date

> Posted via DevelopmentNow.com Groups
> http://www.developmentnow.com/g/

http://en.wikipedia.org/wiki/Newsreader_(Usenet)

SCNR

--
Armin