views:

124

answers:

2

I have an annoying problem. Sometimes Visual Studio does not show option "View designer" for some of my forms in solution explorer. It does not show design mode errors, just doesn't show option to use the designer. I cannot figure out exact cases when this happens.. Does anybody have some ideas about what causes such behavior of solution explorer?

+1  A: 

Your forms are probably inheriting a custom form class.

There may be times when VS doesn't realize that the custom class inherits Form. (eg, if the solution doesn't build).

Try rebuilding the solution.

If you want a more precide answer, please provide more details.

SLaks
Yes, it seems to be the problem.. Changing base type to Form, and then back to MyCustomDialog helps, but is there a way to make VS analyze if my form is a form?
ironic
What is even more strange is that MyCustomDialog is located in library that did not have fails during build for a very long time.
ironic
Try cleaning and rebuilding the solution, it always used to fix that issue when I had it.
Rory
No success. The simplest solution so far is to change base type of form to Form and then back.
ironic
Finally the exact reason was found. Our project is under Source Safe, so typically all files are read only. When Visual Studio (VS) compiles the project it somehow analyzes, which files represent forms and therefore should be opened with Forms Designer. To indicate it for itself VS adds some tag in the .csproj file. BUT if the .csproj file is read-only (as it was in my case), VS cannot modify it, and solution browser still does not knows it is a form. The solution is to make .csproj file not read-only and rebuild everything.
ironic
A: 

I used to have that problem a lot in VS 2003. Each time it happened, I opened up the .csproj file in Notepad and changed the of the class back to "Form".

danbystrom