Error in VS Designer in c#

Ken Lowe 0 Reputation points
2025-10-16T14:43:31.6+00:00

Call is ambiguous between the following methods or properties

Form1.button1_Click(object,Eventargs)

and Form1.button1_Click(object,Eventargs)

Developer technologies | Visual Studio | Setup
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Viorel 124.9K Reputation points
    2025-10-16T17:08:03.98+00:00

    Probably the Form1.cs file contains two or more functions having this definition:

    private void button1_Click( object sender, EventArgs e )
    {
    
    }
    

    Clarify this aspect and only keep one function. Then close and reload the Form Designer.

    If this does not help, show more details.

    1 person found this answer helpful.
    0 comments No comments

  2. Susmitha T (INFOSYS LIMITED) 755 Reputation points Microsoft External Staff
    2025-10-17T06:49:31.3066667+00:00

    Thanks for reaching out!

     Could you check if Form1.Designer.cs also contains a method definition for button1_Click(object, EventArgs) (not just the subscription)? If yes, delete that method from the designer file and keep the one in Form1.cs.

     Confirm there is only one method with this exact signature:

    void button1_Click(object sender, EventArgs e)
    

     

    Let me know if you need any further help with this. We'll be happy to assist.

    If you find this helpful, please mark the response as "answered".


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.