专题文章
时长:00:00更新时间:2020-11-27 22:35:18
本文为大家分享了WinForm预览Office文档的方法,供大家参考,具体内容如下:使用WinForm.WPF.Office组件。原理:使用Office COM组件将Word,Excel转换为XPS文档.将WPF的DocumentViewer控件寄宿到WinForm中.实现预览。1.新建WinForm项目。2.新建WPF用户控件.注意是WPF控件。3.编辑WPF用户控件。<;UserControl ......>;<;Grid>;<;DocumentViewer x:Name="documentViewer"/>;<;/Grid>;<;/UserControl>。VS设计预览显示效果如下:
查看详情