嵌入PowerPoint播放器在C#赢形式 [英] Embed PowerPoint Viewer in C# Win Form

查看:560
本文介绍了嵌入PowerPoint播放器在C#赢形式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以嵌入一个PowerPoint播放器变成一个C#Windows窗体?

Is it possible to Embed a PowerPoint Viewer into a C# Windows Form?

我目前使用下面的code:

I am currently use the following code:

objApp = new PowerPoint.Application();
        //objApp.Visible = MsoTriState.msoTrue;
        objPresSet = objApp.Presentations;
        objPres = objPresSet.Open(ppsAction.FileInfo.FullName, MsoTriState.msoTrue, MsoTriState.msoTrue, MsoTriState.msoFalse);
        objSlides = objPres.Slides;

        //Run the Slide show
        objSSS = objPres.SlideShowSettings;
        objSSS.ShowType = Microsoft.Office.Interop.PowerPoint.PpSlideShowType.ppShowTypeSpeaker;
        objSSS.LoopUntilStopped = MsoTriState.msoTrue;
        objSSS.Run();

        WindowWrapper handleWrapper = new WindowWrapper(objPres.SlideShowWindow.HWND);
        SetParent(handleWrapper.Handle, this.ApplicationPanel.Handle);
        this.ApplicationPanel.Visible = true;
        objPres.SlideShowWindow.Height = ApplicationPanel.Height;
        objPres.SlideShowWindow.Width = ApplicationPanel.Width;
        objPres.SlideShowWindow.Top = 0;
        objPres.SlideShowWindow.Left = 0;

它显示的形式,但位置上的观众和大小是错误的。如何将一个尺寸并正确放置它。

It shows the viewer on the form but the placement and sizing is wrong. How would one size and place it correctly.

另一种选择

我曾经遇到过的意思用于表示对C#赢形式的ActiveX控件的应用Aximp.exe。我怎么会用PPT浏览器使用?

Another option:
I have encountered the Aximp.exe application meant to be used for showing ActiveX controls on the Win Forms in C#. How would I use this with the PPT Viewer?

推荐答案

请参阅链接。您也可以显示在WebBrowser控件的PPT。 这也可能是有用的。

See this link. You can also display the ppt in a WebBrowser control. This might also be useful.

这篇关于嵌入PowerPoint播放器在C#赢形式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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