passing an array between forms

  • Thread starter Thread starter John Devlon
  • Start date Start date
J

John Devlon

Hi,

does anyone know how to pass an array between forms ?

I tried ....

--- FORM 1 ---

Public Array(2) As byte
Array(0) = 1
Array(1) = 5
Public HowMany As byte = 2

Dim NextForm As New Form
NextForm.Array = Array
NextForm.HowMany = HowMany
NextForm.Show()


--- FORM 2 ---
Public Array() As byte
Public HowMany As byte

Redim preserve Array(HowMany)

MessageBox.show (Array(1))


..... but it doesn't work ...


Thanx

John
 
well there are lots of ways
delcare the array in a mod class so every form has access to it
make the array public
Make the array a property

depends on what your trying to do
 

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