自动将自定义 WPFControls 添加到工具箱

发布于 2024-10-06 06:05:23 字数 1010 浏览 0 评论 0原文

我正在尝试将 WPF 控件添加到 VS 2010 中的工具箱。我尝试设置 ToolboxAutopopulate。这只适用于项目内。但我希望每次打开 VS 时都会出现该控件,无论项目如何。

我尝试在删除 tdb 文件后在 RegEdit 中输入一个条目。不知怎的,它仍然没有出现在工具箱中。可以以某种方式帮助我吗?我不知道我错过了什么。如果有人想了解更多细节我可以提供。

我遵循的步骤是:

关闭所有正在运行的 Visual Studio 2008 实例。

  1. 删除位于 \Local\Microsoft\VisualStudio\9.0 文件夹中的 *.tbd 文件(例如:Vista 或 7 中的 C:\Users\\AppData\Local\Microsoft\VisualStudio\9.0)。

  2. 添加新密钥: 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. 在步骤 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.

  1. 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).

  2. Add a new key to:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\ToolboxControlsInstaller

    or 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.

  3. 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一杯敬自由 2024-10-13 06:05:23

尝试将控件的 design.dllvisualstudio.design.dll 安装到 GAC 中。然后,备份现有的 tbd 并删除现有的。现在,启动 Visual Studio,它将创建新的 tbd 文件。现在,它应该加载了。

Try installing your control's design.dll and visualstudio.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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文