Currently I am using an application which play ppt
and flash in WebBrowser Control.
In WebBrowser I am able to hide context menu by using
this.IsWebBrowserContextMenuEnabled = false;
and capture key event by using
this.PreviewKeyDown += new PreviewKeyDownEventHandler(IWebBrowser_PreviewKeyDown);
but while playing the ppt
, both context menu and keypress events are not functioning i.e. I can see context menu and arrow key force the ppt
to change the slide.
Again while playing flash, context menu is visible and I can handle key event. is there any other setting to it can same for whatever (HTML
, PPT
, Flash
, PDF
) is playing in webBrowser?
Edit :1 Here is my existing code
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.....................