自动将自定义 WPFControls 添加到工具箱
我正在尝试将 WPF 控件添加到 VS 2010 中的工具箱。我尝试设置 ToolboxAutopopulate。这只适用于项目内。但我希望每次打开 VS 时都会出现该控件,无论项目如何。
我尝试在删除 tdb 文件后在 RegEdit 中输入一个条目。不知怎的,它仍然没有出现在工具箱中。可以以某种方式帮助我吗?我不知道我错过了什么。如果有人想了解更多细节我可以提供。
我遵循的步骤是:
关闭所有正在运行的 Visual Studio 2008 实例。
删除位于 \Local\Microsoft\VisualStudio\9.0 文件夹中的 *.tbd 文件(例如:Vista 或 7 中的 C:\Users\\AppData\Local\Microsoft\VisualStudio\9.0)。
添加新密钥: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\ToolboxControlsInstaller
或在 x64 操作系统上
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\9.0\ToolboxControlsInstaller
该密钥的命名类似于“QLeftPanel,Version=3.5.30729.1,Culture=neutral,PublicKeyToken=cd45d629e1d8d371”,您可以在其中将 WpfCustCtrl 和 PK 令牌值替换为您自己的值。
在步骤 3 中创建的密钥中,添加以下值:
(默认)=“我的 WPF 控件”这是工具箱选项卡名称,字符串 CodeBase = "C:\Users\Aneesh\Documents\Visual Studio 2010\Projects\QSharedLibrary\QSharedLibrary\bin\Debug\QSharedLibrary.dll" 这是控件程序集的路径。 WPFControls = "1" 这很重要!
I am trying to add a WPF control to the toolbox in VS 2010. I tried setting the ToolboxAutopopulate.This works only within the project. But i want the control to appear every time i open the VS irrespective of the project.
I tried making an entry into the RegEdit after deleting the tdb fils. It somehow doesn't appear in the toolbox still. Can somehow help me?? I don't know what i am missing. If someone wants to know more details i can provide.
The steps i followed were:
Close all running Visual Studio 2008 instances.
Delete *.tbd file located in your \Local\Microsoft\VisualStudio\9.0 folder (for example: C:\Users\\AppData\Local\Microsoft\VisualStudio\9.0 in Vista or 7).
Add a new key to:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\ToolboxControlsInstalleror on x64 OS
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\9.0\ToolboxControlsInstaller
The key is named like "QLeftPanel, Version=3.5.30729.1, Culture=neutral, PublicKeyToken=cd45d629e1d8d371", where you replace the WpfCustCtrl and PK token value with your own.
In the key created in step 3, add the following values:
(Default) = "My WPF Controls" This is the toolbox tab name, String
CodeBase = "C:\Users\Aneesh\Documents\Visual Studio 2010\Projects\QSharedLibrary\QSharedLibrary\bin\Debug\QSharedLibrary.dll" This is the path to your control assembly.
WPFControls = "1" This is important!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试将控件的
design.dll
和visualstudio.design.dll
安装到 GAC 中。然后,备份现有的 tbd 并删除现有的。现在,启动 Visual Studio,它将创建新的 tbd 文件。现在,它应该加载了。Try installing your control's
design.dll
andvisualstudio.design.dll
into GAC. then, take a backup of your existing tbd and delete the existing. Now, launch the Visual Studio, it will create the new tbd files. Now, It should load.