Arraylist Communication between 2 Forms

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Guest's Avatar

    #1

    Arraylist Communication between 2 Forms

    Hi ,
    In C#
    I have a problem when I need to get the ArrayList Data in
    another form
    My ArrayList is empty .
    I write this code to show you the problem
    Please help

    Form1 :

    Public ArrayList Arr = new ArrayList() ;

    for (int i = 0 ; i < 20 ; i ++ )
    {
    Arr.Add(i) ;
    }

    Form2 :

    Form1 Fm1 = new Form1() ;
    for (int i = 0 ; i <
    Fm1.Arr.Count -1 ; i ++ )
    {
    MessageBox.Show ( Fm1.Arr
    [i].ToString() ) ;
    }

Working...