Error: 'Protected Overrides Sub Dispose(disposing As Boolean)' has multiple definitio
Hello....
I am trying a example codes of animated graphics. I rewrote all the code and I found an error which doesn't happen on the example code(I run the example project)
error:
'Protected Overrides Sub Dispose(disposing As Boolean)' has multiple definitions with identical signatures.
when I double clicked the error, I got this in Form1.Designer.vb:
Code:
'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
The 'Dispose' is also on my Form1.vb:
Code:
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
Anybody knows why? and How to solve this?
Re: Error: 'Protected Overrides Sub Dispose(disposing As Boolean)' has multiple defin
Removing any one of the defintions will resolve the error
Re: Error: 'Protected Overrides Sub Dispose(disposing As Boolean)' has multiple defin
Yes,
It works...
I just deleted the one in Form1.Designer.vb
Thank you.
Re: Error: 'Protected Overrides Sub Dispose(disposing As Boolean)' has multiple defin
Quote:
Originally Posted by
sprooch
Yes,
It works...
I just deleted the one in Form1.Designer.vb
Thank you.
Be aware that fiddling around with the designer code could lead to unexpected results. Usually the designer would reset the code as it wants as soon as you change something on the form. So I'd recommend avoid anything with the designer unless it is impossible otherwise.
Re: Error: 'Protected Overrides Sub Dispose(disposing As Boolean)' has multiple defin
I would concur with Pradeep. I would remove the one from your form code and not the designer code. There is a Disposed event which you can use to dispose of any objects you created.
Re: Error: 'Protected Overrides Sub Dispose(disposing As Boolean)' has multiple defin
Thanks for the advise...
I'll change it...