Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Editing Form1.Designer.cs - Major misstake

0 views
Skip to first unread message

Anders Eriksson

unread,
May 3, 2010, 6:08:57 PM5/3/10
to
Hello,

In my program I had a splitcontainer that I after a while realized that I
didn't want. Since I couldn't remove it in Form1.cs (Design) I opened
Form1.Designer.cs and removed all code that had anything to do with the
splitcontainer.

Now all components are gone from Form1.cs(Design)
They are there in Form1.Designer.cs

I could take the backup but then I will miss a days work. Is there some
other way?

PLEASE HELP!

// Anders

--
English is not my first language
so any error, insults or strangeness
has happend during the translation.
Please correct my English so that I
may become better at it!

Jeff Johnson

unread,
May 3, 2010, 6:18:05 PM5/3/10
to
"Anders Eriksson" <andis.e...@gmail.com> wrote in message
news:O8Fq90w6...@TK2MSFTNGP06.phx.gbl...

> In my program I had a splitcontainer that I after a while realized that I
> didn't want. Since I couldn't remove it in Form1.cs (Design) I opened
> Form1.Designer.cs and removed all code that had anything to do with the
> splitcontainer.
>
> Now all components are gone from Form1.cs(Design)
> They are there in Form1.Designer.cs
>
> I could take the backup but then I will miss a days work. Is there some
> other way?
>
> PLEASE HELP!

Open your backup. You should note that certain controls are being added to
your split container (or perhaps one of its panels; I'm not positive). It
will look like this:

this.splitContainer1.Controls.Add(someButton);
this.splitContainer1.Controls.Add(someCheckBox);

and so on. What you need to do is to add these controls to a different
container, like perhaps the form itself:

this.Controls.Add(someButton);
this.Controls.Add(someCheckBox);

After you do this you should see all your controls magically return.


Anders Eriksson

unread,
May 3, 2010, 6:38:56 PM5/3/10
to
Hello Jeff,


> After you do this you should see all your controls magically return.
>
>
You are a real David Copperfield!

Thank you very much! Saved my day (night really)

// Anders

0 new messages