如何在 MS Access VBA 窗体中托管 WPF 控件?

发布于 2024-07-09 22:57:58 字数 260 浏览 10 评论 0原文

我们有一个大型 MS Access 项目,需要 GUI 功能,而这在 VBA/访问表单环境中很难/不可能实现。

随着时间的推移,我们希望重新编写/迁移到以 WPF 作为表示层的托管 C# 环境。

我们实现这一目标的唯一实用方法是在较长的时间内 - 首先转换一些 VBA 表单(这将带来最佳的生产力优势),然后在 12-24 个月的时间内转换整个系统。

您认为最好的方法是什么。 当我们转换 WPF 表单时,MS Access 可以托管它们吗?

We have a large MS Access project that requires GUI functionality that is difficult / impossible to do in the VBA / access forms environment.

Over time, we wish to re-write / migrate to a managed C# environment with WPF as the presentation layer.

The only practical way for us to do this is over a longer period of time - converting some of the VBA forms first (that would give the best productivity benefit), and then over the course of 12-24 months convert the entire system.

What do you believe is the best approach. Can MS Access host the WPF forms as we convert them?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

朱染 2024-07-16 22:57:58

如果您研究 Visual Studio Tools for Office (VSTO) 会怎么样?
您可以使用 C# 为 Office 编写托管 .NET 插件,它将作为功能区与 Office 集成。

现在的问题是 VSTO AFAIK 不支持 Access 加载项。
但是,请查看此处,看来也不是那么不可能。

因此,如果您幸运的话,您可以

  • 为 Access 编写一个 C# 功能区,其中包含您需要的所有高级 GUI
  • 编写可以从 Access 访问的 C# 服务,例如封装重要的业务逻辑,以便您可以逐步移动不仅是 GUI,还可以在 C# 中构建适当的域对象模型。

如果您决定尝试一下,请告诉我结果如何:)
无论如何,祝你好运。

PS 还有其他可能有帮助的东西吗?
访问 2007 开发人员扩展 (ADE)

What if you look into Visual Studio Tools for Office (VSTO) ?
You can write managed .NET addins for Office in C#, that will integrate as ribbons with office.

Now, the problem is that Access add-ins are not supported in VSTO AFAIK.
But, take a look here, it seems to be not that impossible.

So, if you happen to be lucky, you could

  • Write a C# ribbon for Access which would have all the advanced GUI you need
  • Write services in C# that could be accessed from Access to encapsulate important business logic for instance, so that you could gradually move not only GUI, but build proper domain object model in C#.

If you decide to try it out, let me know how it turned out :)
Good luck anyway.

PS something else which maybe is helpful?
Access 2007 Developer Extensions (ADE)

双马尾 2024-07-16 22:57:58

谢谢 badbadboy - 我一定会尝试这个(使用 VSTO)。

解决方案您建议允许 VSTO 与 ms access 一起使用,这似乎有点黑客行为 - 我并不介意这一点,但我对在生产中使用此解决方法感到紧张,如果它不可靠,即不会得到 MS 的支持。

我可以看到这个将允许我托管一个 winforms 控件,该控件又托管一个 WPF 控件。

有人使用生产系统走这条路吗?有什么注意事项吗?

请注意,codeplex 上有一个 VSTO 访问项目模板,它使该过程变得更容易一些。

Thank you badbadboy - I will certainly experiment with this (using VSTO).

The solution you suggested to allow VSTO to work with ms access, does seem slight hackery - not that I mind this, but I am nervous about using this work-around in production if it isn't solid i.e there would be no support from MS.

From what I can see this will allow me to host a winforms control, that in-turn hosts a WPF control.

Anybody gone down this path with a production system - any caveats?

Note there is a VSTO access project template on codeplex that makes the process a little easier.

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