Property default value

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • shapper

    Property default value

    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 _AutoPostBackOn Select As Boolean
    Public Property AutoPostBackOnS elect() As Boolean
    Get
    Return _AutoPostBackOn Select
    End Get
    Set(ByVal value As Boolean)
    _AutoPostBackOn Select = value
    End Set
    End Property ' AutoPostBackOnS elect

    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
  • Peter Bucher [MVP]

    #2
    Re: Property default value

    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.
    ->


    --
    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

    Comment

    Working...