社区
C#
帖子详情
c#如何在窗口中播放PowerPoint,而不是全屏播放?
mysend45716
2007-01-23 12:50:41
网上的例子都是全屏播放而不是在窗口中播放PowerPoint.
...全文
961
3
打赏
收藏
c#如何在窗口中播放PowerPoint,而不是全屏播放?
网上的例子都是全屏播放而不是在窗口中播放PowerPoint.
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
3 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
bill024
2007-01-23
打赏
举报
回复
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Reflection;
namespace WebBrowserOffice
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private Object oDocument;
private System.Windows.Forms.Button button1;
private AxSHDocVw.AxWebBrowser axWebBrowser1;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public Form1()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
this.axWebBrowser1.NavigateComplete2 += new AxSHDocVw.DWebBrowserEvents2_NavigateComplete2EventHandler(this.axWebBrowser1_NavigateComplete2);
this.Load += new System.EventHandler(this.Form1_Load);
this.Closed += new System.EventHandler(this.Form1_Closed);
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
this.button1 = new System.Windows.Forms.Button();
this.axWebBrowser1 = new AxSHDocVw.AxWebBrowser();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
((System.ComponentModel.ISupportInitialize)(this.axWebBrowser1)).BeginInit();
this.SuspendLayout();
//
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.button1.Location = new System.Drawing.Point(36, 304);
this.button1.Name = "button1";
this.button1.TabIndex = 0;
this.button1.Text = "button1";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// axWebBrowser1
//
this.axWebBrowser1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.axWebBrowser1.Enabled = true;
this.axWebBrowser1.Location = new System.Drawing.Point(12, 4);
this.axWebBrowser1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axWebBrowser1.OcxState")));
this.axWebBrowser1.Size = new System.Drawing.Size(576, 280);
this.axWebBrowser1.TabIndex = 1;
this.axWebBrowser1.NavigateComplete2 += new AxSHDocVw.DWebBrowserEvents2_NavigateComplete2EventHandler(this.axWebBrowser1_NavigateComplete2);
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(616, 346);
this.Controls.Add(this.axWebBrowser1);
this.Controls.Add(this.button1);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.Closed += new System.EventHandler(this.Form1_Closed);
((System.ComponentModel.ISupportInitialize)(this.axWebBrowser1)).EndInit();
this.ResumeLayout(false);
}
#endregion
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void button1_Click(object sender, System.EventArgs e)
{
String strFileName;
openFileDialog1.FileName = "";
openFileDialog1.ShowDialog();
strFileName = openFileDialog1.FileName;
if(strFileName.Length != 0)
{
Object refmissing = System.Reflection.Missing.Value;
oDocument = null;
axWebBrowser1.Navigate(strFileName, ref refmissing , ref refmissing , ref refmissing , ref refmissing);
}
}
private void Form1_Load(object sender, System.EventArgs e)
{
button1.Text = "Browse";
openFileDialog1.Filter = "Office Documents(*.doc, *.xls, *.ppt)|*.doc;*.xls;*.ppt" ;
openFileDialog1.FilterIndex = 1;
}
private void Form1_Closed(object sender, System.EventArgs e)
{
oDocument = null;
}
private void axWebBrowser1_NavigateComplete2(object sender, AxSHDocVw.DWebBrowserEvents2_NavigateComplete2Event e)
{.
Object o = e.pDisp;
oDocument = o.GetType().InvokeMember("Document",BindingFlags.GetProperty,null,o,null);
Object oApplication = o.GetType().InvokeMember("Application",BindingFlags.GetProperty,null,oDocument,null);
Object oName = o.GetType().InvokeMember("Name",BindingFlags.GetProperty ,null,oApplication,null);
}
}
}
mysend45716
2007-01-23
打赏
举报
回复
举个例子a!
bill024
2007-01-23
打赏
举报
回复
用WebBrowser加载office
C#
的WPF使用OFFICE库
播放
PPT
这里所说的是将PPT的
播放
嵌入到自己的程序
中
,用代码控制PPT的
播放
。感兴趣的朋友可以了解一下,代码可以下载
C#
在扩展桌面
播放
PPT并且无任务栏按钮
首先是
播放
PPT的部分 ObjApp = new ppt.Application(); var objPresSet = ObjApp.Presentations; var objPrs = objPresSet.Open(url, MsoTriState.msoTrue, MsoTriState.msoTrue, MsoTriState.msoFalse); ObjPrs = objPrs; var objSlides = objPrs.Slides; objSss = objPrs.SlideShowS
播放
PowerPoint
(PPT)并嵌入窗体
根据需求,需要在我们的应用程序
中
可以
播放
PPT并操作翻页。 由于使用的是c++ builder,没有VS的Windows控件库,所以一开始的打算是把PPT当成一个整体
窗口
来处理。 操作步骤: (1)以
播放
方式打开PPT 通过Baidu发现是POWERPNT.EXE启动的PPT,所以可以通过ShellExcute(windowsApi),使用exe打开指定...
Windows 检测PPT WPS 幻灯片
播放
并获取
窗口
句柄
需求背景: 应用投屏时,选择了PPT
窗口
进行投屏后,如果此时用户点击了
播放
幻灯片,此时是创建了一个新的
窗口
,此时远端
播放
的还是之前的
窗口
。 需求:
播放
后需要切换到PPT幻灯片放映
窗口
实现步骤: 1、区分PPT幻灯片放映
窗口
和编辑
窗口
PPT编辑
窗口
PPT放映
窗口
exe名称 wpp.exe(wps) wpp.exe(wps)
窗口
属性 WS_POPUP 无控制按钮
窗口
标题 1.pptx - WPS 演示(wps) WPS演示 幻灯片放映 - [1.pptx] (WPS)
MFC通过COM操作在对话框
中
显示
PowerPoint
幻灯片(重点解决幻灯片
全屏
闪烁问题)
MFC通过COM操作在对话框
中
显示
PowerPoint
幻灯片,并解决闪烁问题
C#
110,561
社区成员
642,566
社区内容
发帖
与我相关
我的任务
C#
.NET技术 C#
复制链接
扫一扫
分享
社区描述
.NET技术 C#
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧
+ 用AI写文章