C
Chukkalove
Im sorry, I dont know the correct description for a hierarchy of parent and
child forms.
I have a main form that opens a child form modally. This child form in turn
opens it's own child form modally.
I also have a separate thread running that monitors a card reader. If the
user removes the card then the thread calls back the main form to tell it
that the card was pulled. The main form should then close down any children
leaving the main form as the only one that's open.
How do i do this cleanly and with as little code as possible please? I'd
prefer not to have to add code to all the forms if possible.
I thought that if I closed the "child" form from the main form, that this
"child" would kill its own "children". This isnt happening. Neither the
"child" or its "children" are closing.
When i used to code in delphi, the owner would always be passed to a child
when the child was constructed, and the child would add itself to its owners
Controls list. I assume this isnt happening here
I also tried changing the constructor for every form so that each form would
add itself to it's owners OwnedForm list. This also didnt work and was very
messy.
thank you
child forms.
I have a main form that opens a child form modally. This child form in turn
opens it's own child form modally.
I also have a separate thread running that monitors a card reader. If the
user removes the card then the thread calls back the main form to tell it
that the card was pulled. The main form should then close down any children
leaving the main form as the only one that's open.
How do i do this cleanly and with as little code as possible please? I'd
prefer not to have to add code to all the forms if possible.
I thought that if I closed the "child" form from the main form, that this
"child" would kill its own "children". This isnt happening. Neither the
"child" or its "children" are closing.
When i used to code in delphi, the owner would always be passed to a child
when the child was constructed, and the child would add itself to its owners
Controls list. I assume this isnt happening here
I also tried changing the constructor for every form so that each form would
add itself to it's owners OwnedForm list. This also didnt work and was very
messy.
thank you