Re: ShowDialog and ArrayList?

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Jonathan Allen (x_at_x.x)
Date: 09/26/04


Date: Sun, 26 Sep 2004 09:36:09 -0700

1. Add a watch for the array.
2. Step through the code until you find the moment that the array is
changed.

-- 
Jonathan Allen
"Strahimir Antoljak" <strah@netzero.net> wrote in message
news:eYJCGZXoEHA.3392@TK2MSFTNGP15.phx.gbl...
> I keep an ArrayList in the external class. The external class is passed
into
> a form via New constructor (see below). I process some data with functions
> within the form before showing the form. I populate the array contained in
> the passed class, then I show the form modally (frm.ShowDialog) so the
user
> can interact, and when the user closes the form, the array is emtpy.
> Why??????
> I check the Count property before, and after the showing the form and when
I
> close the form this empties array? Any idea? Help!!
>
> Debug.WriteLine(en.alAnM.Count) ---> gives e.g. 16
> Dim eResult As DialogResult = Me.ShowDialog
> If eResult = DialogResult.Cancel Then
>          Exit Function
> End If
> Debug.WriteLine(en.alAnM.Count) ------> gives 0 !?
>
>
> The array list alAnM is stored in the class within another project within
> common solution (sln). Why the ShowDialog procedure empties array?
>
>
>
>
>
>   Public Sub New(ByRef _en As MyClass)
>         MyBase.New()
>         'This call is required by the Windows Form Designer.
>         InitializeComponent()
>         en = _en
>     End Sub
>
> Private en as MyClass
>
>
>
>
> -- 
> Strah @ Langan
>
>


Relevant Pages

  • ShowDialog and ArrayList?
    ... I keep an ArrayList in the external class. ... can interact, and when the user closes the form, the array is emtpy. ... Dim eResult As DialogResult = Me.ShowDialog ... Why the ShowDialog procedure empties array? ...
    (microsoft.public.dotnet.languages.vb)
  • Re: ShowDialog and ArrayList?
    ... Is alAnM a field or a property? ... Add a watch for the array. ... >>> I keep an ArrayList in the external class. ... Why the ShowDialog procedure empties array? ...
    (microsoft.public.dotnet.languages.vb)
  • Re: ShowDialog and ArrayList?
    ... P.S. Don't use MyClass as a type name. ... Add a watch for the array. ... >>> I keep an ArrayList in the external class. ... Why the ShowDialog procedure empties array? ...
    (microsoft.public.dotnet.languages.vb)
  • Re: ShowDialog and ArrayList?
    ... Add a watch for the array. ... >> I keep an ArrayList in the external class. ... Why the ShowDialog procedure empties array? ... >> Strah @ Langan ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Penalty for instantiating an object tens of thousands of times
    ... > Public Shadows Property itemAs Rectangle ... > Public Function add(ByVal iRectangle As Rectangle) As Integer ... > Public Sub addRangeAs Rectangle) ... >>>> use an array of any data type. ...
    (microsoft.public.dotnet.languages.vb)