msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem to create instances of arrays as properties of array

 
Post new topic   Reply to topic    msvisual.com Forum Index -> VB Syntax
Author Message
magriii



Joined: 04 Oct 2007
Posts: 1

PostPosted: Wed Jun 27, 2007 5:14 pm    Post subject: Problem to create instances of arrays as properties of array Reply with quote

Hello
I run into problems on how to create array instances. I'm playing around for
hours now and can't find a solution for this. How can I assign an instance of
the Mysegment class to the rendition segments property?
Any help is greatly appreciated.
Thanks
magriii


Public Class Form1

Partial Public Class Segment
Private segmentNumberField As Integer
Private nameField As String

Public Property SegmentNumber() As Integer
Get
Return Me.segmentNumberField
End Get
Set(ByVal value As Integer)
Me.segmentNumberField = value
End Set
End Property

Public Property Title() As String
Get
Return Me.nameField
End Get
Set(ByVal value As String)
Me.nameField = value
End Set
End Property
End Class

Partial Public Class Segments
Private segmentField() As Segment

Public Property Segment() As Segment()
Get
Return Me.segmentField
End Get
Set(ByVal value As Segment())
Me.segmentField = value
End Set
End Property
End Class

Partial Public Class Rendition
Private idField As String
Private segmentsField As Segments

Public Property ID() As String
Get
Return Me.idField
End Get
Set(ByVal value As String)
Me.idField = value
End Set
End Property

Public Property Segments() As Segments
Get
Return Me.segmentsField
End Get
Set(ByVal value As Segments)
Me.segmentsField = value
End Set
End Property
End Class

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim MyRendition As Rendition = New Rendition
Dim mysegments() As Segments = New Segments() {}
Dim MySegment As Segment = New Segment

MySegment.SegmentNumber = 1
MySegment.Title = "test"

MyRendition.ID = "123"
'''PROBLEM starts here
MyRendition.Segments().Segment(0) = MySegment

End Sub
End Class

Archived from group: microsoft>public>vb>syntax
Back to top
View user's profile Send private message
Bob Butler



Joined: 04 Oct 2007
Posts: 1081

PostPosted: Wed Jun 27, 2007 5:16 pm    Post subject: Re: Problem to create instances of arrays as properties of a Reply with quote

"magriii" wrote in message @microsoft.com...
> Hello
> I run into problems on how to create array instances.


--
You need to ask in a newsgroup with "dotnet" in the name. This group is for
VB 6.0 and earlier and does not include VB.Net or VB 200x.

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    msvisual.com Forum Index -> VB Syntax All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group