无法在Visual Studio 2010中使用Windows窗体取回设计器视图窗口 [英] Unable to get the designer view window back using windows forms with Visual Studio 2010

查看:68
本文介绍了无法在Visual Studio 2010中使用Windows窗体取回设计器视图窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Visual Studio Express 2010 ENU SP1编写C#Windows Forms应用程序.VS的更多详细信息位于本文的底部.我最近使用设计器视图对布局进行了一些更改,然后决定不希望更改,因此关闭了设计器窗口.当我关闭项目时,代码窗口仍然打开,并且更改以任何方式保存.我不在乎更改,因为可以轻松恢复布局,除了我找不到任何重新打开可视设计器窗口的方法外.为了找回窗口,我尝试了以下方法:

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

我有一个VS 2010团队的评估版,在使用我的项目时它显示出完全相同的行为

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

我已经尝试过该项目的备份副本,但是在Express版本和Team版本中都显示相同的问题

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

我到过MSDN,VS论坛和整个Internet,却找不到任何解决方案

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

当我第一次启动该项目时,我确实从解决方案资源管理器中重命名了Form1.cs文件,因为我想为该应用程序使用一个不同于Form1的名称.在执行此操作时,它会询问以下内容:

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:

您正在重命名文件.是否要在此项目中对所有对代码元素'projectname'的引用进行重命名?

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

我回答是.因此,现在我没有Form1.cs文件,而是一个带有"projectname.cs"和设计器文件名为"projectname.Design.cs"的文件.这是我所做的唯一更改,我认为可能是我确实尝试过将其重命名为Form1.cs,但这也无法解决问题.

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.

我不得不说我是使用Visual Studio的新手.到目前为止,我相当喜欢它,但是我现在已经死在水里了,除非我解决这个问题,否则我将失去两个星期的工作.任何帮助将不胜感激.

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.

谢谢,-汤姆

其他详细信息:

Windows 7 Professional SP1 32位x86

Windows 7 Professional SP1 32 bit x86

Microsoft Visual Studio 2010版本10.0.40219.1 SP1RelMicrosoft .NET Framework版本4.0.30319 SP1Rel

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

安装版本:C#Express

Installed Version: C# Express

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

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

Microsoft Visual C#2010 Express-ENU Service Pack 1(KB983509)KB983509此Service Pack适用于Microsoft Visual C#2010 Express-ENU.如果您以后安装更新的Service Pack,该Service Pack将被自动卸载.

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.

推荐答案

我意识到这现在已经是一个老话题了,但是我在VS2010中的一个项目中也发生了类似的事情.无法在表单设计器中编辑表单.

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.

最后,在.csproj文件中找到了问题所在.有一个项目组指定要编译的内容.在商品组标签中,对于我的表单,它具有...

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" />

它需要...

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

缺少SubType XML标记.快速更改项目文件,我可以再次编辑表单.

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

这篇关于无法在Visual Studio 2010中使用Windows窗体取回设计器视图窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆