帮助!!未处理的异常..... MyBase.Dispose(处置) [英] HELP!! Unhandled Exception.....MyBase.Dispose(disposing)

查看:248
本文介绍了帮助!!未处理的异常..... MyBase.Dispose(处置)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我创建了我的应用程序,但是一种形式继续给我一个错误.关闭表单时出现此错误.其他所有形式都可以,我不知道发生了什么....

错误:

您的应用程序中发生了未处理的异常.如果单击继续",则应用程序将忽略此错误并尝试继续.如果单击退出",该应用程序将立即关闭.

收藏集已修改;枚举操作可能无法执行.


我认为与 mybase.dispose(dispose)有关,但我不知道如何解决此问题.

系统代码如下:

Hello Everyone,

I created my application, but one form keep on giving me an error. I get this error when I close the form. All other forms are ok, and I have no idea what is going on....

The Error:

Unhandled exception has occurred in your application. If you click Continue, the application will ignore this error and attempt to continue. If you click Quit, the application will close immediately.

Collection was modified; enumeration operation may not execute.


I think is related to the mybase.dispose(dispose), but I have no idea how to fix this issue.

The system code is as follow:

'Form overrides dispose to clean up the component list.
    <System.Diagnostics.DebuggerNonUserCode()> _
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        Try
            If disposing AndAlso components IsNot Nothing Then
                components.Dispose()
            End If
        Finally
            MyBase.Dispose(disposing)
        End Try
    End Sub

推荐答案

什么是components.Dispose()?

我认为可能有问题.

如果组件是可丢弃的集合,而您尝试为每个循环使用这些组件,则可能会出现此错误.

如果这样做没有帮助,请提供更多代码.
what is components.Dispose()?

I think there could be something wrong.

If components is a disposable collection and you try to dispose items using for each loop, that can give you this error.

Provide more code, if this doesn''t help.


这篇关于帮助!!未处理的异常..... MyBase.Dispose(处置)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆