'System.StackOverflowException'

starcraft

Centurion
Joined
Jun 29, 2003
Messages
167
Location
Poway CA
I JUST started a project i got like 5 things onthe thing before errors came... goodie. In form i had -
Visual Basic:
Public frm3 As New Form1()
    Public frm2 As New Form2() 
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        frm3.Hide()
        frm2.show()
    End Sub
and in form 2 i had -
Visual Basic:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        RichTextBox1.Text = ""
        RichTextBox1.Text = "Tutorial 1:"
    End Sub
and when i try and debug i get this-
An unhandled exception of type 'System.StackOverflowException' occurred in Unknown Module.
whats wrong?
 
I usually encounter StackOverflowException in infinite loops. I noticed that in Form1, you had this code:

Visual Basic:
Public frm3 As New Form1()
...

I tried something similar and didn't get the exception, but my app just terminated and brought me back to the .NET IDE. Maybe that line shouldn't be there anyway.
 
Back
Top