Gert-Jan van der Kamp

Hi,

I had a form with lot's of objects (splitters, trees, buttons etc). For some reason, i don't see them anymore. I can;t think what i must have done to do that, one minute they were there, the next they were all gone. I'm left with a form that looks like a new one.

I can still see the objects in the form in the property explorer and on the bottom of the design srface,and they're still in form.designer.cs code, but VS doesn;t display it anymore. Is there some kind of command that tells VS to go through designer.cs and build the form

Has anyone experienced this, how do get them back. It's been a while since my last check-in so i'm pretty freaked out here.

I really hope anyone can help me out here,

Gert-Jan




Re: Visual C# IDE Can't see form anymore..... panic!

TaylorMichaelL

If you run the form do the controls display properly If not then I would wager that maybe you inadvertently set the size, location or visibility of the controls such that they are no longer visible. Also be sure that every BeginUpdate call in the InitializeComponent function has a matching EndUpdate otherwise the controls won't render properly.

If the controls do display properly then I'd wager that something went wrong in the dsigner. Did you try closing VS and opening it back up

Michael Taylor - 8/16/07

http://p3.net.mvps.org





Re: Visual C# IDE Can't see form anymore..... panic!

Chris Brandsma

In adition to what TaylorMichealL said, also check what the controls are parented to.

You should find that in the partial class for the form (in 2005) or hidden in a region block.

Anyway, what you are looking for is: <control/form>.Controls.Add(<your control here>)

Every control but the main form should have a parent.





Re: Visual C# IDE Can't see form anymore..... panic!

Citizen on the earth

Hello Gert-Jan,

When you found the controls in a form couldn't be visible, you can try the following possible solutions and check if they work for you:
1.Just as TaylorMichaelL suggested, you can try to close your current project and reopen it again to check if it works for you.


2. Try to rebuild your project and check if the invisible controls in a form appear again.
Notes:

The detailed steps are to open a project with controls invisible in a form and right mouse click the project in the solution explorer to choose "Rebuild" in the context menu.

3.When the controls in a form disappeared in your project, you can try to create a new form with some controls and check if they are visible. If this is not true, try to restart your Visual Studio again and maybe you can get this issue resolved.

Notes:

If you didn't save your current project and restart your VS.NET 2005 IDE, you will loose something important to you.

If you have any questions about it, please don't hesitate to let me know. Thanks.

Citizens on the earth





Re: Visual C# IDE Can't see form anymore..... panic!

Gert-Jan van der Kamp

Everybody thanks for suggestions, but none worked. I had to redo the whole thing....

Thanks,

Gert-Jan






Re: Visual C# IDE Can't see form anymore..... panic!

LittleDjee

Gert-Jan van der Kamp,

had you had nay news concerning your problem.

I have the same problem. My form disapeared when I tried to regroup my form in a folder in MV2005. If a tun the application, I can see the form. I just can't modify it anymore because I don't see it. I observ that the in the tree view, my designer is not like other forms. Forms1.designer.cs is not regroup under Forms1.cs.

How can I regroup or correct this situation to see my Form again

Thanks





Re: Visual C# IDE Can't see form anymore..... panic!

Gert-Jan van der Kamp

Be careful not to close VS2005, chances are that you accidentally deleted a crucial line in the form.designer.cs. Maybe you can get it back using undo.

I closed VS2005 so the undo's were gone. I had to recreate the thing. Now i check it in every day.

Good luck,

GJ






Re: Visual C# IDE Can't see form anymore..... panic!

John Willemse

Seems like the namespaces of Form1.cs and Form1.designer.cs are not identical in your case LittleDjee. Have you checked that If you change the namespace of a form for whatever reason, make sure to change it in the designer as well since the class is partial and relies on the namespace to hold the two together.

Best regards,
John Willemse





Re: Visual C# IDE Can't see form anymore..... panic!

LittleDjee

I tried to edit my .csproj file to make my form identical to the others. With the tag <embedded> I was able to regroup my designer with my Form in my tree view. I then close MV and when I opened it back, I could see my form again.

I'll also take a look at the namespace.

Thanks for the help

Regards,

Little Djee