简体   繁体   English

Excel工作表中的C#VSTO主机WPF表单

[英]c# VSTO Host WPF form inside Excel sheet

I would like to embed a standalone WPF form inside an Excel sheet. 我想在Excel工作表中嵌入一个独立的WPF表单。

Microsoft provide information on how to host a WPF form inside an Excel Action Pane or Task Pane here: https://msdn.microsoft.com/en-us/library/bb772076.aspx Microsoft在此处提供有关如何在Excel操作窗格或任务窗格中托管WPF表单的信息: https : //msdn.microsoft.com/zh-cn/library/bb772076.aspx

However, I'm unable to find information on how I can do this within the Excel sheet itself. 但是,我无法在Excel工作表本身中找到有关如何执行此操作的信息。 Is this possible? 这可能吗? Should I just load the form when the user clicks on the tab? 当用户单击选项卡时,是否应该只加载表单? Or is there a better way to do this? 还是有更好的方法来做到这一点?

I've never seen that anywhere so I guess it's not possible. 我从没在任何地方见过,所以我猜不可能。 What I have done a few times ( but never in production ) is your second suggestion 我已做过几次( 但从未在生产中进行过 )是您的第二个建议

Should I just load the form when the user clicks on the tab? 当用户单击选项卡时,是否应该只加载表单? Or is there a better way to do this? 还是有更好的方法来做到这一点?

Yes, this should work fine, there is something like WPF host you can use on standard form or create another project in your solution ( WPF project ) and call it from VSTO 是的,这应该可以正常工作,您可以在标准表单上使用WPF主机之类的东西,也可以在解决方案中创建另一个项目( WPF项目 ),然后从VSTO调用它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM