Property Default Value

S

shapper

Hello,

I am working on a class to be added to profile.
One of the class properties is language.

I want to set "pt-PT" as default value:

Private _Language As String
Public Property Language() As String
Get
Return _Language
End Get
Set(ByVal value As String)
_Language = value
End Set
End Property

How can I do this?

Thanks,
Miguel
 
M

Masudur

shapper said:
Hello,

I am working on a class to be added to profile.
One of the class properties is language.

I want to set "pt-PT" as default value:

Private _Language As String
Public Property Language() As String
Get
Return _Language
End Get
Set(ByVal value As String)
_Language = value
End Set
End Property

How can I do this?

Thanks,
Miguel

Hi,
what is stopping from doing
Private _Language As String = "pt-PT"

or
Public Property Language() As String
Get
If _Language = "" Then
_Language = "pt-PT"
End If
Return _Language
End Get
Set(ByVal value As String)
_Language = value
End Set
End Property

Masudur
 

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

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top