Question Get structure elements

cheelhor

New member
Joined
Jun 19, 2008
Messages
1
Programming Experience
Beginner
[clsMR.vb] At Project 1
VB.NET:
Public Class clsMR
    Public Codestring As String
Public Linenumber As Integer
End Class


[clsP.vb] At Project 2
VB.NET:
Private mRec As clsMR
Private mRecs As System.Collections.Generic.List(Of clsMR)

private sub AddItem()
 mRec = New clsMR
 With mRec
      .Codestring = mTextbox
      .Linenumber = mTextLineNumber
 End With
  mRecs.Add(mRec)
End Sub
mTextBox and mTextLineNumber is the variable to hold the String and integer data. There is another function at Project 2 which open the file and pass the file contents into AddItem.

How do I access the structure element? at anywhere of the Form ? [At Project 2] Something like this
getCodeString = clsP.mRecs.item(0).Codestring
 
Last edited by a moderator:
Back
Top