Can anyone help with this problem plz...
I'm trying to display / hide forms but I keep coming up with an error.
Here's the code:
frmMain.vb
frmLogin.vbCode:Public Class frmMain Inherits System.Windows.Forms.Form Dim LoginForm As New frmLogin Private Sub btnQuit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQuit.Click Me.Close() End Sub Private Sub btnLogIn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogIn.Click Me.Hide() LoginForm.Show() End Sub
When I try to run this code I get no compile errors, but then I get a "Just-In-Time Debugging" pop-up, with the error: "An exception 'System.StackOverflowException' has occurred".Code:Public Class frmLogin Inherits System.Windows.Forms.Form Dim MainForm As New frmMain Private Sub btnBack_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBack.Click Me.Hide() MainForm.Show() End Sub End Class
I'm really stuck on this now so any help would be great.
TIA MJM






Reply With Quote