Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
378 views
in Technique[技术] by (71.8m points)

c# - Unable to get the designer view window back using windows forms with Visual Studio 2010

I am in process of writing a C# Windows Forms application using Visual Studio Express 2010 ENU SP1. Further VS specifics are at the bottom of this post. I recently made some changes using the designer view to the layout and then decided that I did not want the changes so I closed the designer window. The code window was still up when I closed the project and the changes were saved any way. I don't care about the changes because the layout can be restored easily except for the fact that I cannot find any way to reopen the visual designer window. To get the window back I have tried the following:

Shift F7

Right click in the designer code window

Double click the designer file under the solution explorer

Select the designer file under the solution explorer and use the context menu to bring up the file

I have an evaluation copy of the VS 2010 Team and it displays exactly the same behavior when utilizing my project

I have tried a backup copy of the project but it displays the same problem in both the Express and Team versions

I have been all over the MSDN, VS forum, and the internet at large and not found any solutions

When I first started the project I did rename the Form1.cs file from within the solution explorer because I wanted to have a different name than Form1 for the application. When doing this it asked the following:

"You are renaming a file. Would you like to perform a rename in this project of all references to the code element 'projectname'?

I replied yes. So now I don't have a Form1.cs file but a file with my "projectname.cs" and the designer file named "projectname.Design.cs. This is the only change that I made that I can think of that might be relevant. I did try renaming it back to Form1.cs but that also did not resolve the problem.

I have to say that I am new to using Visual Studio. So far I like it quite a bit but I am dead in the water right now and unless I can get this resolved I will lose two weeks worth of work. Any assistance would be greatly appreciated.

Thanks, -Tom

Additional Details:

Windows 7 Professional SP1 32 bit x86

Microsoft Visual Studio 2010 Version 10.0.40219.1 SP1Rel Microsoft .NET Framework Version 4.0.30319 SP1Rel

Installed Version: C# Express

Microsoft Visual C# 2010 01014-169-2560017-70726 Microsoft Visual C# 2010

Microsoft Visual C# 2010 Express - ENU Service Pack 1 (KB983509) KB983509 This service pack is for Microsoft Visual C# 2010 Express - ENU. If you later install a more recent service pack, this service pack will be uninstalled automatically.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I realise this is quite an old thread now, but I just had something similar happen in one of my projects in VS2010. There was no way to edit the Form in the form designer.

In the end tracked it down to a problem in the .csproj file. There is a item group that specifies what is compiled. Within the item group tag, for my form it had ...

<Compile Include="AreaChart.cs" />

it needed...

<Compile Include="AreaChart.cs">
  <SubType>Form</SubType>
</Compile>

The SubType XML tag was missing. A quick change to the project file and I could edit the form again.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...