troubleshooting Question

how to use a structure as property of a vb class??

Avatar of altariamx2003
altariamx2003Flag for Mexico asked on
Visual Basic.NET
8 Comments1 Solution317 ViewsLast Modified:

I have this class
Public Class data
    Public Structure ParamCar
        Public Alfa As Double
        Public Eta As Double
        Public Mw7P As Double
        Public Z7P As Double
        Public Sg7P As Double
        Public Cf As Double
        Public Kw As Double
        Public Ja As Double
        Public Ya As Double
        Public Nscn As Integer
        Public Banderascn As Integer
        Public Metdesdob As Integer
        Public n As Integer
        Public metSg As Integer
        Public metTb As Integer
        Public metCriticas As Integer
        Public metTc As Integer
        Public metPc As Integer
        Public metomega As Integer
        Public ieq As Integer
    End Structure

    Private _mystructure As data.ParamCar
    Public Property mystructure() As data.ParamCar
            Return _mystructure
        End Get
        Set(ByVal value As data.ParamCar)
            _mystructure = value
        End Set
    End Property

    Private _name As String
    Public Property name() As String
            Return name
        End Get
        Set(ByVal value As String)
            dmyarray1 = value
        End Set
    End Property
End Class

and when I tried to use it
     Dim example As New data()
        example.mystructure.Alfa = 34

vb show me the following error: "Expression is a value and therefore cannot be the target of an assignment"
What Im doing wrong?

It is ok how I declare and use the structure as a property???

why vb show that error???
Mike Tomlinson
High School Computer Science, Computer Applications, Digital Design, and Mathematics Teacher
Join our community to see this answer!
Unlock 1 Answer and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros