Property default value

  • Thread starter Thread starter shapper
  • Start date Start date
S

shapper

Hello,

I have two properties in a custom control. One is of a boolean type
and the other is an enum type.

How can I define a default value when they are not defined?

Here is my code:

Private _AutoPostBackOnSelect As Boolean
Public Property AutoPostBackOnSelect() As Boolean
Get
Return _AutoPostBackOnSelect
End Get
Set(ByVal value As Boolean)
_AutoPostBackOnSelect = value
End Set
End Property ' AutoPostBackOnSelect

Private _Type As WebMenuItemType
Public Property Type() As WebMenuItemType
Get
Return _Type
End Get
Set(ByVal value As WebMenuItemType)
_Type = value
End Set
End Property ' Type

Thanks,
Miguel
 
Hi shapper
I have two properties in a custom control. One is of a boolean type
and the other is an enum type.

How can I define a default value when they are not defined?
With Attributes.
->
http://www.google.ch/search?hl=de&q=property+default+value+attribute+vb.net&meta=

--
Gruss, Peter Bucher
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland
http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community
http://www.aspnetzone.de/blogs/peterbucher/ - Auf den Spuren von .NET
http://www.peterbucher.ch/ - Meine Persönliche Seite
 
Back
Top