Thanks very much, i'll look into what you suggested right away.
The array list is used to store all open internet explorer window
objects. This in turn is used to populate a listview. However I only
need to give the user an option of selecting which window to work with
if there is more than one explorer window open. So, I have created
another form and will only call this choosewindow form if their is more
than one internet explorer window.
In order to check how many explorer window objects are in the
arraylist, i need to be able to check it's size from the new form i've
just created.
Now i dont know if i should build the array in my new form, and then
access it in the original choosewindow form, or if i should keep it as
it is in the choosewindow form, and just change it's access so i can
access it in my new form.
Hope that explains it a bit better,
Thanks,
Gary.
Ciaran O''Donnell wrote:
You could declare a public property on the choosewindow for to access it. You
would however need to have an instance of the form to use it. Otherwise you
could declare it and the property static which would stop you needing an
instance.
What is the arraylist for, it would help to know to recommend the best
coarse of action.
--
Ciaran O''Donnell
http://wannabedeveloper.space.live.com
"ga********@myway.com" wrote:
Hello everyone.
I have a project at the moment which is working fine. I originally
coded my code in form1.cs, as this was the default code file generated
by Visual Studio. However now i'm trying to organise it better, so have
renamed the file to ChooseWindow and chose the autorename feauture, and
everything works fine.
I have just added a second form which will become my primary form
eventually, and I will call the original form (ChooseWindow) from this
new primary form. The problem i have is that the array list is setup in
the original form and I cant access it in the new form I have just
created. I need to be able to access this arraylist in both code files.
How do i declare it so that I can access it in both code files and not
just the original ChooseWindow code file?
Thanks very much,
Gary.
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using SHDocVw;
namespace InternetExplorerInterface
{
public partial class Choosewindow : Form
{
public Choosewindow() // Pull up the form
{
InitializeComponent();
}
ArrayList ar = new ArrayList();
}