passing arrays as parameters

  • Thread starter Thread starter kmercer46
  • Start date Start date
K

kmercer46

have a class that contains an array and i would like to access the
individual array elements in a form. I understand that VB.net does not
allow the array to be public and i think i need to pass it as a
parameter? What i would like is on the form, to have a button when
clicked, it checks the elements against each other to see if they are
different (they are integers).

I have looked on the net for some guidance on this but not found
anything useful. Can anyone give me some help please with this in terms
of the code because im going round in circles here and nothing seems to
work.

Thanks
 
have a class that contains an array and i would like to access the
individual array elements in a form. I understand that VB.net does not
allow the array to be public and i think i need to pass it as a
parameter?

VB.NET allows array variables to be public members of a class. I suggest to
implement a property which wraps around the array:

\\\
Private m_Names() As String

Public Property Names() As String()
Get
Return m_Names
End Get
Set(ByVal Value As String())
m_Names = Value
End Set
End Property
///
 

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

Back
Top