How to fix broken winform designer?

Posted on 2009-02-17
Last Modified: 2013-11-26
In VS.NET 2008 (.NET 3.5), someone renamed a button in the designer auto gen'd code.  Everything builds and works fine except the designer.  When you open the designer in, if gives an error:

The type 'System.Windows.Forms.UserControl' has no property named 'TheNewButtonName'.

If I name the button back to the old name, it still gives the error.  Is there a way to fix this?
Question by:brettr
    LVL 26

    Accepted Solution

    create a new form and then copy the controls from the designer and past them to the new form - i hope that the form is still opening in the designer mode


    does your user control "System.Windows.Forms.UserControl" has the property 'TheNewButtonName'
    if not then remove or comment the line in which 'TheNewButtonName' is there
    search for 'TheNewButtonName' and comment the line
    LVL 15

    Expert Comment

    Have you tried doing a Clean on the solution?  I normally find that works.

    Author Comment

    I had delete the button in question.  The designer came back.  Then I added a new button and set the property.  I don't see how the above solutions apply.  Unless someone says otherwise, I'm going to close the question.
    LVL 15

    Expert Comment

    From what I can see that was ragi0017's suggestion about removing the button.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
    Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now