Sub Properties

S

shapper

Hello,

Can I create a sub property of a property in MyClass?

For example:
Private _Subject As String
Public WriteOnly Property Subject() As String
Set(ByVal value As String)
_Subject = value
End Set
End Property

Then create two subproperties:
Subject.PT and Subject.EN.

Does this make any sense?

Thanks,
Miguel
 
M

Mark Fitzpatrick

Not like this. A property or method is exposed on an object and doesn't have
children really. Ifthis subject has a number of parts, then perhaps it
should be it's own object. Then, instead of the subject being a string, it's
an object. The object then has a number of properties. So for example,
MyClass.Subject.PT would be a property of the object Subject, which is an
object that is exposed as a property of your class.
 
C

Cowboy \(Gregory A. Beamer\)

This is not the way to localize. You are better to set the string and then
use a resource file to pull up the correct value for the field. If you do
this, you can end up in as many languages as you might like. Using your
method, if it was possible, you will end up recompiling your project every
time you get in another language.
 
S

shapper

Hi,

Yes I know this is not a way to localize.
It was just the example I though off. :) Bad example, I admit it. :)

Thanks,
Miguel
 

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

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top