G
Guest
I put this question on a new thread because, in spirit, it is a new question.
I apologize that I have difficulty formulating the proper question.
My application performs matrix computations on data stored in arrays A, B,
…G. Populate subs fill a datagrid on instances of form2 with the elements of
the arrays (one form2 instance per array) so that the user can see what is in
the arrays. The caption of the form2 instances displays what array is being
displayed. For any given array, the visible representation needs to remain
available for review long after the completion of the populate sub. Also,
there can be only one form2 instance corresponding to each array - visible
at any one moment because the user needs to know what is in the arrays now,
not earlier.
I originally used a global constructor for each individual form2. As the
corresponding array was changed (say array A) the populate sub (say
populateA) would re-bind the form2 (say Matrix_A) to the new array data.
This approach worked well but it was very slow with huge arrays when they
were being repopulated or closed altogether (which in this implementation
involved setting the datagrid.datasource to nothing and hiding the form). It
was recommended that instead, I construct the Matrix_A repeatedly and
locally. This also works well and its fast. But it has the major drawback
that when I change the underlying array and repopulate the form2 I get
exactly two form2’s visible: the old one and the new one.
I know I can close the old one by physically clicking its close control. But
I cannot see how I can do this in code as – although it is visible – it no
longer exists (because the sub that created it has completed).
What’s a mathematician to do?
I apologize that I have difficulty formulating the proper question.
My application performs matrix computations on data stored in arrays A, B,
…G. Populate subs fill a datagrid on instances of form2 with the elements of
the arrays (one form2 instance per array) so that the user can see what is in
the arrays. The caption of the form2 instances displays what array is being
displayed. For any given array, the visible representation needs to remain
available for review long after the completion of the populate sub. Also,
there can be only one form2 instance corresponding to each array - visible
at any one moment because the user needs to know what is in the arrays now,
not earlier.
I originally used a global constructor for each individual form2. As the
corresponding array was changed (say array A) the populate sub (say
populateA) would re-bind the form2 (say Matrix_A) to the new array data.
This approach worked well but it was very slow with huge arrays when they
were being repopulated or closed altogether (which in this implementation
involved setting the datagrid.datasource to nothing and hiding the form). It
was recommended that instead, I construct the Matrix_A repeatedly and
locally. This also works well and its fast. But it has the major drawback
that when I change the underlying array and repopulate the form2 I get
exactly two form2’s visible: the old one and the new one.
I know I can close the old one by physically clicking its close control. But
I cannot see how I can do this in code as – although it is visible – it no
longer exists (because the sub that created it has completed).
What’s a mathematician to do?