Property

S

shapper

Hello,

I have the following property:

' Culture
Public Property Culture() As String
Get
Return CType(Me("Culture"), String)
End Get
Set(ByVal value As String)
Me("Culture") = value
End Set
End Property ' Culture

How can I define a default value, for example "en-GB" when the culture
is empty?

Thanks,
Miguel
 
H

Hans Kesting

Hello,
I have the following property:

' Culture
Public Property Culture() As String
Get
Return CType(Me("Culture"), String)
End Get
Set(ByVal value As String)
Me("Culture") = value
End Set
End Property ' Culture

How can I define a default value, for example "en-GB" when the culture
is empty?

Thanks,
Miguel

either make sure Me("Culture") always has a value (maybe in the
constructor),
or add some code to the "get": if Me("Culture") is empty then return
"en-GB" else return it's real value.

Hans Kesting
 

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

Similar Threads

C# How to convert date into en-US when thread culture is ar-SA 1
Culture. What am I doing wrong? 1
Is Nothing problem 16
Property 0
Property 1
Control Property. 3
Culture 0
Property default value 1

Members online

No members online now.

Forum statistics

Threads
473,999
Messages
2,570,246
Members
46,844
Latest member
JudyGvh32

Latest Threads

Top