为什么我的工具箱项目在Visual Studio 2008中消失了?

时间:2022-09-25 12:36:13

I'm working on a solution that contains multiple projects targeting Windows Mobile 5 and standard Windows applications.

我正在开发一个包含多个针对Windows Mobile 5和标准Windows应用程序的项目的解决方案。

Lately when opening up a form in designer the common UI controls (textbox, button, label, etc etc...) have vanished leaving only the controls defined within the project.

最近,当在设计器中打开表单时,常见的UI控件(文本框,按钮,标签等等)已经消失,只留下项目中定义的控件。

Resetting the toolbox has no effect. A google search suggested deleting the toolbox temp files in the Local Settings\Application Data\Microsoft\VisualStudio\9.0, however this was only successful in bringing back the default controls for Windows Mobile 5. The WinForms controls are still mysteriously missing.

重置工具箱无效。谷歌搜索建议删除Local Settings \ Application Data \ Microsoft \ VisualStudio \ 9.0中的工具箱临时文件,但这只能成功恢复Windows Mobile 5的默认控件.WinForms控件仍然神秘地丢失。

Also, if I right-click and Select All on the toolbox, all of the WinForms controls do in fact come up, however they're all grayed out.

此外,如果我右键单击并在工具箱上选择全部,所有WinForms控件实际上都会出现,但它们都是灰色的。

Has anyone else experienced this?

还有其他人经历过这个吗?

9 个解决方案

#1


2  

I just had a similiar problem. In a managed C++ project all the default toolbox items disappeared form the winforms designer. After playing around for a while I found that there was a problem in the .vcproj file.

我刚才有一个类似的问题。在托管C ++项目中,所有默认工具箱项都从winforms设计器中消失。在玩了一会儿之后,我发现.vcproj文件中存在问题。

<VisualStudioProject
    ProjectType="Visual C++"
    Version="9,00"
    Name="COLLADA Import"
    ProjectGUID="{0DEEF9B6-1929-44E3-92EC-13712839FB63}"
    RootNamespace="COLLADAImport"
    Keyword="ManagedCProj"
    TargetFrameworkVersion="0"
    >

When you set TargetFrameworkVersion to a valid number, for example 131072 for .Net 2.0, the toolbox items will be back.

当您将TargetFrameworkVersion设置为有效数字时,例如131072 for .Net 2.0,工具箱项目将返回。

#2


2  

If you right click on the Toolbox and select 'Choose Items...' and then sort by the 'Namespace' column, you can then select the ones you need (for example System.Windows.Forms for WinForms).

如果右键单击工具箱并选择“选择项目...”,然后按“命名空间”列排序,则可以选择所需的那些(例如,WinForms的System.Windows.Forms)。

You can multiselect with Shift and then select/deselect the group.

您可以使用Shift进行多选,然后选择/取消选择该组。

The controls then reappear in the Toolbox as enabled.

然后控件重新出现在工具箱中启用。

#3


1  

I've noticed this exact same thing for regular WinForms as well. I can't speak to mobile applications but in regular winforms this has a tendency to happen.

对于常规的WinForms,我也注意到了这一点。我不能说移动应用程序,但在常规winforms中,这种情况有发生。

I believe it's actually a bug in Visual Studio.

我相信它实际上是Visual Studio中的一个错误。

There are some things you can do (again, for WinForms. I'm not sure about mobile) with adding attributes to your control. Such as:

你可以做一些事情(对于WinForms来说也是如此。我不确定移动设备)为控件添加属性。如:

[ToolboxBitmap(typeof(MyControl), "MyControlBitmap")]

There are some other useful related things on this site:

此站点还有一些其他有用的相关内容:

http://en.csharp-online.net/Design-Time_Integration-Attributes

#4


1  

I had exactly the same problem (after installing Windows Mobile SDK all items in the toolbox were greyed out).

我有完全相同的问题(安装Windows Mobile SDK后,工具箱中的所有项目都显示为灰色)。

I've startet the Visual Studio 2008 command line as administrator and started the following command (WARNING - all your settings are lost !!)

我以管理员身份启动Visual Studio 2008命令行并启动以下命令(警告 - 所有设置都丢失!!)

devenv /setup /resetuserdata /selfreg /resetskippkgs

After that the toolbox looked fine and worked like on the first day. The idea came from this thread: connect.microsoft.com

之后,工具箱看起来很好,并在第一天工作。这个想法来自这个线程:connect.microsoft.com

#5


1  

Go to the Tools menu and choose import & export settings, then choose the 'reset all' setting, then yes. Save your current settings, after that you'll have your toolbox reappear.

转到“工具”菜单并选择“导入和导出设置”,然后选择“全部重置”设置,然后选择“是”。保存当前设置,之后您将重新显示工具箱。

#6


0  

Actually you may be able to add a registry key to get this to work also.

实际上,您也可以添加一个注册表项以使其工作。

#7


0  

Make sure you're not in Debug mode.

确保您没有处于调试模式。

#8


0  

If you are running Visual Studio 2008 under vista, try running it as an Administrator. Right click on the shortcut and select Run as Administrator.

如果您在vista下运行Visual Studio 2008,请尝试以管理员身份运行它。右键单击快捷方式,然后选择以管理员身份运行。

#9


0  

Well guess what install Service pack 1 for VS 2008 and it would go away and if you have wireless mouse and keyboard turn it off. Choose one of these two both work.

好吧,猜猜是什么安装VS 2008 Service Pack 1,它会消失,如果你有无线鼠标和键盘关闭它。选择这两个中的一个都可以工作。

#1


2  

I just had a similiar problem. In a managed C++ project all the default toolbox items disappeared form the winforms designer. After playing around for a while I found that there was a problem in the .vcproj file.

我刚才有一个类似的问题。在托管C ++项目中,所有默认工具箱项都从winforms设计器中消失。在玩了一会儿之后,我发现.vcproj文件中存在问题。

<VisualStudioProject
    ProjectType="Visual C++"
    Version="9,00"
    Name="COLLADA Import"
    ProjectGUID="{0DEEF9B6-1929-44E3-92EC-13712839FB63}"
    RootNamespace="COLLADAImport"
    Keyword="ManagedCProj"
    TargetFrameworkVersion="0"
    >

When you set TargetFrameworkVersion to a valid number, for example 131072 for .Net 2.0, the toolbox items will be back.

当您将TargetFrameworkVersion设置为有效数字时,例如131072 for .Net 2.0,工具箱项目将返回。

#2


2  

If you right click on the Toolbox and select 'Choose Items...' and then sort by the 'Namespace' column, you can then select the ones you need (for example System.Windows.Forms for WinForms).

如果右键单击工具箱并选择“选择项目...”,然后按“命名空间”列排序,则可以选择所需的那些(例如,WinForms的System.Windows.Forms)。

You can multiselect with Shift and then select/deselect the group.

您可以使用Shift进行多选,然后选择/取消选择该组。

The controls then reappear in the Toolbox as enabled.

然后控件重新出现在工具箱中启用。

#3


1  

I've noticed this exact same thing for regular WinForms as well. I can't speak to mobile applications but in regular winforms this has a tendency to happen.

对于常规的WinForms,我也注意到了这一点。我不能说移动应用程序,但在常规winforms中,这种情况有发生。

I believe it's actually a bug in Visual Studio.

我相信它实际上是Visual Studio中的一个错误。

There are some things you can do (again, for WinForms. I'm not sure about mobile) with adding attributes to your control. Such as:

你可以做一些事情(对于WinForms来说也是如此。我不确定移动设备)为控件添加属性。如:

[ToolboxBitmap(typeof(MyControl), "MyControlBitmap")]

There are some other useful related things on this site:

此站点还有一些其他有用的相关内容:

http://en.csharp-online.net/Design-Time_Integration-Attributes

#4


1  

I had exactly the same problem (after installing Windows Mobile SDK all items in the toolbox were greyed out).

我有完全相同的问题(安装Windows Mobile SDK后,工具箱中的所有项目都显示为灰色)。

I've startet the Visual Studio 2008 command line as administrator and started the following command (WARNING - all your settings are lost !!)

我以管理员身份启动Visual Studio 2008命令行并启动以下命令(警告 - 所有设置都丢失!!)

devenv /setup /resetuserdata /selfreg /resetskippkgs

After that the toolbox looked fine and worked like on the first day. The idea came from this thread: connect.microsoft.com

之后,工具箱看起来很好,并在第一天工作。这个想法来自这个线程:connect.microsoft.com

#5


1  

Go to the Tools menu and choose import & export settings, then choose the 'reset all' setting, then yes. Save your current settings, after that you'll have your toolbox reappear.

转到“工具”菜单并选择“导入和导出设置”,然后选择“全部重置”设置,然后选择“是”。保存当前设置,之后您将重新显示工具箱。

#6


0  

Actually you may be able to add a registry key to get this to work also.

实际上,您也可以添加一个注册表项以使其工作。

#7


0  

Make sure you're not in Debug mode.

确保您没有处于调试模式。

#8


0  

If you are running Visual Studio 2008 under vista, try running it as an Administrator. Right click on the shortcut and select Run as Administrator.

如果您在vista下运行Visual Studio 2008,请尝试以管理员身份运行它。右键单击快捷方式,然后选择以管理员身份运行。

#9


0  

Well guess what install Service pack 1 for VS 2008 and it would go away and if you have wireless mouse and keyboard turn it off. Choose one of these two both work.

好吧,猜猜是什么安装VS 2008 Service Pack 1,它会消失,如果你有无线鼠标和键盘关闭它。选择这两个中的一个都可以工作。