目前我正在使用一个可以播放的应用程序ppt
并在 WebBrowser 控件中闪烁。
在 WebBrowser 中,我可以使用隐藏上下文菜单
this.IsWebBrowserContextMenuEnabled = false;
并使用捕获关键事件
this.PreviewKeyDown += new PreviewKeyDownEventHandler(IWebBrowser_PreviewKeyDown);
但在玩的时候ppt
,上下文菜单和按键事件都不起作用,即我可以看到上下文菜单和箭头键强制ppt
更改幻灯片。
再次在播放 Flash 时,上下文菜单可见,我可以处理按键事件。是否有任何其他设置可以相同(HTML
, PPT
, Flash
, PDF
) 正在网络浏览器中播放吗?
Edit :1这是我现有的代码
class IWebBrowser : WebBrowser
public IWebBrowser(RegionOptions options)
{
try
{
this.Width = 600;
this.Height = 400;
this.IsWebBrowserContextMenuEnabled = false;
this.ScrollBarsEnabled = false;
this.ScriptErrorsSuppressed = true;
this.WebBrowserShortcutsEnabled = false;
this.AllowNavigation = true;
CreateContextMenu();
this.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(IWebBrowser_DocumentCompleted);
this.PreviewKeyDown += new PreviewKeyDownEventHandler(IWebBrowser_PreviewKeyDown);
}
catch (Exception ex)
{
log.Error("IWebBrowser - ctor ", ex);
}
}
private void CreateContextMenu()
{
ContextMenuStrip myContextMenu = new ContextMenuStrip();
this.ContextMenuStrip = myContextMenu;
ToolStripMenuItem myFirstTooltip = new ToolStripMenuItem();
ToolStripMenuItem mySecondTooltip = new ToolStripMenuItem();
ToolStripMenuItem myThirdTooltip = new ToolStripMenuItem();
myFirstTooltip.Text = "Item One";
mySecondTooltip.Text = "Item Two";
myThirdTooltip.Text = "Item Three";
myContextMenu.Items.Add(myFirstTooltip);
myContextMenu.Items.Add(mySecondTooltip);
myContextMenu.Items.Add(myThirdTooltip);
}
context menu Images for different controls played in webbrowser
Display a webpage..................
flash played in webbrowser.................
ppt played in webbrowser.....................