Alright, I am using VB.NET and I like using properties but there better be a way to do what I need or its a serious issue. Heres my dilemma:
I have a Structure, lets call it StructA;
Ok lets pretend its been defined.
Now I make a property....
Property ForStructA()
How would I define the property to effectively be able to use it with the struct.....
ex:
Now declare a variable:
now the property:
.....
I want to be able to go like this:
PropA.UserName = Bob
PropA.Age = 14
and for it to set the variable VarA (thru the prop) to:
VarA.UserName = Bob
VarA.Age = 14
.....
i hope that makes sense i tried hard to explain it now pls someone help me out thx....
I have a Structure, lets call it StructA;
Ok lets pretend its been defined.
Now I make a property....
Property ForStructA()
How would I define the property to effectively be able to use it with the struct.....
ex:
Visual Basic:
Structure StructA
Dim UserName
Dim Age
End Structure
Now declare a variable:
Visual Basic:
Dim VarA As StructA
now the property:
Visual Basic:
Property PropA As ?????(StructA)
Get
Return VarA.??????
End Get
Set
????????
End Set
End Property
I want to be able to go like this:
PropA.UserName = Bob
PropA.Age = 14
and for it to set the variable VarA (thru the prop) to:
VarA.UserName = Bob
VarA.Age = 14
.....
i hope that makes sense i tried hard to explain it now pls someone help me out thx....
Last edited: