I am new to .NET and have a problem with VB.NET garbage collection.
I have declared a form in a module as public, and call it from the main program form. However, once I close it (.close), it is 'garbaged collected' and seems to lose its declaration, and therefore my app errors when I try to show the form again. I have resorted to hiding the form, but is there a neater way of handling this?
I've declaring it locally, but
modGlobals:
============
Public frmBankSettings As New frmbank()
MainForm:
=========
Public Sub mnuBanker_Click(...) Handles mnuBanker.Click
'Dim frmbanksettings As New frmbank()
frmBankSettings.Show()
End Sub
I have declared a form in a module as public, and call it from the main program form. However, once I close it (.close), it is 'garbaged collected' and seems to lose its declaration, and therefore my app errors when I try to show the form again. I have resorted to hiding the form, but is there a neater way of handling this?
I've declaring it locally, but
modGlobals:
============
Public frmBankSettings As New frmbank()
MainForm:
=========
Public Sub mnuBanker_Click(...) Handles mnuBanker.Click
'Dim frmbanksettings As New frmbank()
frmBankSettings.Show()
End Sub