The DefaultValueAttribute does not actually set the property value but just informs the editor what default value has been set in code. Hopefully the example will clarify the concept.
Imports System.ComponentModel
Public Class MyClass
Private Const InitialValue As Int32 = 37
Private pvalue As Int32
Public Sub New()
pvalue = InitialValue
End Sub
<DefaultValue(InitialValue)> _
Public Property MyProperty() As Int32
Get
Return pvalue
End Get
Set
pvalue = value
End Set
End Property
End Class
Additionally note that an attribute specifies a constant value so it is not possible to say that a default value is the very variable DateTime.Now.
Alan