gpt4 book ai didi

c# - 在 wpf 窗口中打开 excel 文件

转载 作者:行者123 更新时间:2023-11-30 22:05:03 25 4
gpt4 key购买 nike

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

enter image description here

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

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。 This page可能是一个好的开始。总而言之,它必须包含在您使用 ActiveX 的 UI 中。

本身并没有纯 WPF excel 控件。

如果您需要在不需要打开现有文件的情况下模仿某些 excel 功能,可以在 Internet 上免费或免费使用大量“类似 excel”的控件。例如this one .

关于c# - 在 wpf 窗口中打开 excel 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24646872/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com