G
Guest
I'm currently developing a CF app on Windows Mobile CE and VB.NET. The app is
working fine, well that is until you minimize it. It appears the GC kicks in
and decides to collect my forms! so when I return the screens are blank. Some
background on the technique I'm using might be helpful.
To make maintenance easier and to also provide a easier way to combine UI
elements. I am dynamically loading Forms (basically treating them as a
control - which seems to work fine given we don't have a user control). I'll
assign the parent of the dynamic form to a design time placed panel. This all
works as stated, except when the forms are minimized.
I've tried the following:
Adding the forms the the panel's controls collection. Same effect as setting
Forms parent to the panel.
Putting the forms into both module level hashtables and shared hashtables.
Hoping they wouldn't get collected as they are being referenced. Result -
didn't work.
Next, I found that I could trap the closing event of the form. I then
prevented the close from happening if the app is in a minimzed state. Result:
Works! well for awhile - if you maximise the form for say 30 secs it seems
ok. However, having the form in a minimized state for a longer period kills
the app!
This is pretty much a show stopper for the app I'm working on, so any help
would be greatly appreciated.
Regards
Garry McGlennon
working fine, well that is until you minimize it. It appears the GC kicks in
and decides to collect my forms! so when I return the screens are blank. Some
background on the technique I'm using might be helpful.
To make maintenance easier and to also provide a easier way to combine UI
elements. I am dynamically loading Forms (basically treating them as a
control - which seems to work fine given we don't have a user control). I'll
assign the parent of the dynamic form to a design time placed panel. This all
works as stated, except when the forms are minimized.
I've tried the following:
Adding the forms the the panel's controls collection. Same effect as setting
Forms parent to the panel.
Putting the forms into both module level hashtables and shared hashtables.
Hoping they wouldn't get collected as they are being referenced. Result -
didn't work.
Next, I found that I could trap the closing event of the form. I then
prevented the close from happening if the app is in a minimzed state. Result:
Works! well for awhile - if you maximise the form for say 30 secs it seems
ok. However, having the form in a minimized state for a longer period kills
the app!
This is pretty much a show stopper for the app I'm working on, so any help
would be greatly appreciated.
Regards
Garry McGlennon