G
GrandpaB
While writing this plea for help, I think I solved my
dilemma, but I don't know why the statement that solved
the problem is necessary. The inspiration for the
statement came from an undocumented VB example I found on
the web. I would be most appreciative if someone could
explain why this statement is necessary and what does it
do?
MyArt = New Art ' **** ??????? ****
Early in the code, MyArt and ArtList had been
declared with the following statements:
Public ArtList as New ArrayList
Public MyArt as New Art
'Art is a class that contains 6 Strings & 1 Integer
I am creating a Windows application which uses an
ArrayList to contain a small amount of data. ArtList, is
an instance of an ArrayList that will contain multiple
(up to 200) Art objects. MyArt is an instance of the Art
class. In the application I want to add, delete and
edit the individual Art objects in ArtList. I can
sucessfully edit the Art objects by transferring a
selected object from the ArtList to MyArt and then to the
application's Form with the following code.
MyArt = ArtList(Index)
MyArt2Form()
Then after changes have been made to the form, I transfer
the edited information from the Form, to MyArt and
finally back to ArtList with the following code:
Form2MyArt()
ArtList(Index) = MyArt
However, in the case where I want to add a new object to
the ArtList, why I must reinitialize MyArt with the
following statement?
MyArt = New Art '**** ??????? ****
Form2MyArt
ArtList.Add(MyArt)
Thanks, GrandpaB
dilemma, but I don't know why the statement that solved
the problem is necessary. The inspiration for the
statement came from an undocumented VB example I found on
the web. I would be most appreciative if someone could
explain why this statement is necessary and what does it
do?
MyArt = New Art ' **** ??????? ****
Early in the code, MyArt and ArtList had been
declared with the following statements:
Public ArtList as New ArrayList
Public MyArt as New Art
'Art is a class that contains 6 Strings & 1 Integer
I am creating a Windows application which uses an
ArrayList to contain a small amount of data. ArtList, is
an instance of an ArrayList that will contain multiple
(up to 200) Art objects. MyArt is an instance of the Art
class. In the application I want to add, delete and
edit the individual Art objects in ArtList. I can
sucessfully edit the Art objects by transferring a
selected object from the ArtList to MyArt and then to the
application's Form with the following code.
MyArt = ArtList(Index)
MyArt2Form()
Then after changes have been made to the form, I transfer
the edited information from the Form, to MyArt and
finally back to ArtList with the following code:
Form2MyArt()
ArtList(Index) = MyArt
However, in the case where I want to add a new object to
the ArtList, why I must reinitialize MyArt with the
following statement?
MyArt = New Art '**** ??????? ****
Form2MyArt
ArtList.Add(MyArt)
Thanks, GrandpaB