locked
Objects in windows form [Design] desappeared RRS feed

  • Question

  • I am working on mocrosoft visual studio 2013 and i had my design form ready and was adding something in the code for a new chart, when i started to see the performance, the desing form was empty.. since then i was not able to find those items, i tried to add another "chart1" (that was the name of the chart i was using) but it tells me that chart already exists.

    thank you.

    Thursday, November 12, 2015 8:59 PM

Answers

  • In solution explorer expand your form out so you see the designer, resx and class. It's a triangle you click in vs2015, might be a + in vs2013 - the thing to the left of the form anyhow.

    Double click your form.designer.cs file in visual studio and take a look at all the code which builds your form.

    Your original chart will be in there but something will be wrong with it.

    It'll be hidden, size 0 or something.

    If you can't figure it out then grab your code behind and save a copy in notepad or something.

    In fact, back up your entire solution. Zip it or something.

    In your solution, strip it all back to like

        public partial class Form2 : Form
        {
            public Form2()
            {
                InitializeComponent();
            }

    Remove all references to your chart1 in that designer code.

    Make sure it compiles OK.

    Drag another chart onto your designer as a chart1 replacement.

    Make sure you still see that when you close and re-open visual studio.

    This is to ensure that it's not visual studio is broke.

    Then add your code behind back in.

    Do it piece by piece and take a look at each piece, just in case there's something bad in there you overlooked.

    Good luck.


    Hope that helps.

    Technet articles: WPF: MVVM Step 1; All my Technet Articles


    Friday, November 13, 2015 12:14 PM