在WPF中的窗口内打开Excel文件 [英] Open excel file inside a window in wpf

查看:734
本文介绍了在WPF中的窗口内打开Excel文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的wpf窗口中显示一个excel文件,如下所示:

I want to show an excel file inside my wpf window like this:

如果我创建一个excel应用程序,然后将Visible属性设置为true,则Excel应用程序将打开,并且我不希望出现这种情况.

if I Create an excel application and then set Visible property to true, Excel application will open and I don't want this behavior.

Microsoft.Office.Interop.Excel.Application xlsxApp = new Microsoft.Office.Interop.Excel.Application();
Workbook workbook = xlsxApp.Workbooks.Open(path);
xlsxApp.Visible=true; //Excel will open, I don't want this.

推荐答案

您正在寻找的是嵌入在Wpf控件中的Excel.

What you are looking for is Excel embedded in a Wpf Control. This page could be a good start. To sum it up, it must be included in your UI using ActiveX.

本身没有纯粹的WPF excel控件.

There is not pure WPF excel control per se.

如果您需要模仿某些excel功能而不需要打开现有文件,则Internet上有很多免费的类似Excel的"控件,这些控件可以免费使用也可以免费使用.例如这一个.

If you need to mimic some excel features without the need to open an existing file, there are plenty of "excel like" controls available on the internet free or not. For instance this one.

这篇关于在WPF中的窗口内打开Excel文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆