Property default value


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
 
Ad

Advertisements

P

Peter Bucher [MVP]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top