|
-
May 12th, 2009, 04:14 AM
#1
Thread Starter
Junior Member
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?
-
May 12th, 2009, 04:22 AM
#2
Re: Error: 'Protected Overrides Sub Dispose(disposing As Boolean)' has multiple defin
Removing any one of the defintions will resolve the error
Please mark you thread resolved using the Thread Tools as shown
-
May 12th, 2009, 05:05 AM
#3
Thread Starter
Junior Member
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.
-
May 12th, 2009, 07:26 AM
#4
Re: Error: 'Protected Overrides Sub Dispose(disposing As Boolean)' has multiple defin
 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.
-
May 12th, 2009, 07:36 AM
#5
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.
"Ok, my response to that is pending a Google search" - Bucky Katt.
"There are two types of people in the world: Those who can extrapolate from incomplete data sets." - Unk.
"Before you can 'think outside the box' you need to understand where the box is."
-
May 12th, 2009, 07:41 AM
#6
Thread Starter
Junior Member
Re: Error: 'Protected Overrides Sub Dispose(disposing As Boolean)' has multiple defin
Thanks for the advise...
I'll change it...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|