this is the first form known as a login when I switched from login to registration then registration to log in the memory keep increasing it won't stop how can I resolve this?
Private Sub LinkLabel1_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
Me.Hide()
Dim registration As New Registration()
registration.Show()
GC.Collect()
GC.WaitForPendingFinalizers()
GC.Collect()
Close()
End Sub
the second form is known as registration
Private Sub LinkLabel1_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles linkLabel1.LinkClicked
Me.Hide()
Dim login As New Login()
login.Show()
GC.Collect()
GC.WaitForPendingFinalizers()
GC.Collect()
Close()
End Sub
I'm using materialskin and a panel with image on each form and garbage collector won't work and the close() looks like it didnt work