Results 1 to 6 of 6

Thread: Error: 'Protected Overrides Sub Dispose(disposing As Boolean)' has multiple definitio

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2009
    Posts
    24

    Question 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?

  2. #2
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    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

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Apr 2009
    Posts
    24

    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.

  4. #4
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: Error: 'Protected Overrides Sub Dispose(disposing As Boolean)' has multiple defin

    Quote Originally Posted by sprooch View Post
    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.
    Pradeep, Microsoft MVP (Visual Basic)
    Please appreciate posts that have helped you by clicking icon on the left of the post.
    "A problem well stated is a problem half solved." — Charles F. Kettering

    Read articles on My Blog101 LINQ SamplesJSON ValidatorXML Schema Validator"How Do I" videos on MSDNVB.NET and C# ComparisonGood Coding PracticesVBForums Reputation SaverString EnumSuper Simple Tetris Game


    (2010-2013)
    NB: I do not answer coding questions via PM. If you want my help, then make a post and PM me it's link. If I can help, trust me I will...

  5. #5
    PowerPoster SJWhiteley's Avatar
    Join Date
    Feb 2009
    Location
    South of the Mason-Dixon Line
    Posts
    2,256

    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."

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Apr 2009
    Posts
    24

    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
  •  



Click Here to Expand Forum to Full Width