Click here to Skip to main content
15,908,901 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
VB
'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer
    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()> _
    Private Sub InitializeComponent()
        Me.pb = New System.Windows.Forms.PictureBox()
        Me.HScrollBar1 = New System.Windows.Forms.HScrollBar()
        CType(Me.pb, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'pb
        '
        Me.pb.BackColor = System.Drawing.Color.WhiteSmoke
        Me.pb.Dock = System.Windows.Forms.DockStyle.Fill
        Me.pb.Location = New System.Drawing.Point(0, 0)
        Me.pb.Name = "pb"
        Me.pb.Size = New System.Drawing.Size(603, 471)
        Me.pb.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
        Me.pb.TabIndex = 0
        Me.pb.TabStop = False
        '
        'HScrollBar1
        '
        Me.HScrollBar1.Location = New System.Drawing.Point(0, 0)
        Me.HScrollBar1.Name = "HScrollBar1"
        Me.HScrollBar1.Size = New System.Drawing.Size(80, 17)
        Me.HScrollBar1.TabIndex = 1
        '
        'frmImage
        '
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
        Me.ClientSize = New System.Drawing.Size(603, 471)
        Me.Controls.Add(Me.HScrollBar1)
        Me.Controls.Add(Me.pb)
        Me.Name = "frmImage"
        Me.Text = "frmImage"
        CType(Me.pb, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)
    End Sub
I get an error on the line Private Sub InitializeComponent() that says
"has multiple definitions with identical signatures"

what do I need to do?:confused:
Posted
Updated 28-Jul-10 19:28pm
v2

Buy a book ? Post the actual error message ? Post your code, not the autogenerated code ? Have you defined your own variable that has the same name as one you define in the forms designer ?
 
Share this answer
 
It appears that you have two methods called InitializeComponent() within that class. Look through all the other files that are part of that class and look for InitializeComponent. If there are multiple versions, either:

1. Delete one. Honestly, the InitializeComponent method is auto-generated by Visual Studio itself, so you do not need to make your own version, unless you made a version that is supposed to load the form differently. In that case, move on to the other 2 options.

2. Add parameters to one of them. Adding a parameter to one of them will solve this issue. However, make sure you also have one that does not have a parameter, as the application calls this when making the form, and it does not expect parameters.

3. Rename one of them. That will also solve the issue. Consider renaming it to InitializeComponent2 or something like that. Remember to keep one named InitializeComponent because, again, the application calls this when making the form.

Unless you have a different idea, I'd suggest doing one of the three.

InitializeComponent is a method used by applications that controls how a form is loaded and how it is set-up. For example, if you have a TextBox in a form and set it's Text property in the IDE, that change is made in InitializeComponent. Usually, developers don't modify InitialzeComponent unless they have a reason to mess with it.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900