'System.StackOverflowException'

starcraft

Well-known member
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 -
Code:
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 -
Code:
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:

[VB]
Public frm3 As New Form1()
...
[/VB]

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