473,383 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

access array across multiple forms

I am creating a program with 2 forms and on the first one i have
created an arraylist. On the second one I want to call the arraylist
to display its contents in a textbox. I am having trouble figuring out
how to make the arraylist that is on the first form visible to the
second form so I can have some code display its contents. Any help
would be greatly appreciated. Thanks

Alex

Feb 2 '07 #1
4 1455
On Feb 2, 2:59 pm, FrAxEl...@gmail.com wrote:
I am creating a program with 2 forms and on the first one i have
created an arraylist. On the second one I want to call the arraylist
to display its contents in a textbox. I am having trouble figuring out
how to make the arraylist that is on the first form visible to the
second form so I can have some code display its contents. Any help
would be greatly appreciated. Thanks

Alex
You can make a property on the form that contains the ArrayList. Make
this property return the ArrayList, and then the other form can use
this property to access the arrayList.

Feb 2 '07 #2
On Feb 2, 3:08 pm, lord.zol...@gmail.com wrote:
On Feb 2, 2:59 pm, FrAxEl...@gmail.com wrote:
I am creating a program with 2 forms and on the first one i have
created an arraylist. On the second one I want to call the arraylist
to display its contents in a textbox. I am having trouble figuring out
how to make the arraylist that is on the first form visible to the
second form so I can have some code display its contents. Any help
would be greatly appreciated. Thanks
Alex

You can make a property on the form that contains the ArrayList. Make
this property return the ArrayList, and then the other form can use
this property to access the arrayList.
forgive my stupidity, but how exactly do you do that?

Feb 2 '07 #3
Alex,

There are a lot of methods,

First of all you can change the constructer from your second form and make
it overloaded.

Public sub New (Byval MyArraylist as Arraylist)
MyForm2Arraylist = MyArratlist
End Sub
Private MyForm2ArrayList as Arraylist

However you can pass the reference as well as property or whatever.

Cor
<Fr*******@gmail.comschreef in bericht
news:11*********************@a75g2000cwd.googlegro ups.com...
>I am creating a program with 2 forms and on the first one i have
created an arraylist. On the second one I want to call the arraylist
to display its contents in a textbox. I am having trouble figuring out
how to make the arraylist that is on the first form visible to the
second form so I can have some code display its contents. Any help
would be greatly appreciated. Thanks

Alex

Feb 3 '07 #4
On 2007-02-02, Fr*******@gmail.com <Fr*******@gmail.comwrote:
On Feb 2, 3:08 pm, lord.zol...@gmail.com wrote:
>On Feb 2, 2:59 pm, FrAxEl...@gmail.com wrote:
I am creating a program with 2 forms and on the first one i have
created an arraylist. On the second one I want to call the arraylist
to display its contents in a textbox. I am having trouble figuring out
how to make the arraylist that is on the first form visible to the
second form so I can have some code display its contents. Any help
would be greatly appreciated. Thanks
Alex

You can make a property on the form that contains the ArrayList. Make
this property return the ArrayList, and then the other form can use
this property to access the arrayList.

forgive my stupidity, but how exactly do you do that?
public class MyForm
private theList As new ArrayList()

public readonly property TheList() As ArrayList
get
return me.theList
end get
end property
end class

--
Tom Shelton
Feb 6 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
49
by: Yannick Turgeon | last post by:
Hello, We are in the process of examining our current main application. We have to do some major changes and, in the process, are questionning/validating the use of MS Access as front-end. The...
55
by: AnandaSim | last post by:
I just had a google through this NG but have not seen mention of Erik Rucker's blog entry and the new Jet: http://blogs.msdn.com/access/archive/2005/10/05/477549.aspx mentioned by Mike...
37
by: jasmith | last post by:
How will Access fair in a year? Two years? .... The new version of Access seems to service non programmers as a wizard interface to quickly create databases via a fancy wizard. Furthermore, why...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.