Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exit/Close a form in VB.Net

Status
Not open for further replies.

FoxT2

MIS
Oct 3, 2003
143
US
Hello,

I updated a VB6 project into VB.Net and for some reason when I exit the form it errors on this code...

Private Sub Form1_Closed(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Closed
Me.Close() < ----- here
End Sub

Error message:
An unhandled exception of type 'System.StackOverflowException' occurred in system.windows.forms.dll

Thanks,

FoxT
 
Its because that event fires when the form has closed.

So its like you tell your form to close, it closes, then you tell it to close again.

that's why the error is happening.

D'Arcy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top