如何从gecko webbrowser控件中删除contextmenu项,“我想在浏览器中禁用视图源”

时间:2013-12-17 12:28:29

标签: c# geckofx

private void geckoWebBrowser1_ShowContextMenu(object sender, GeckoContextMenuEventArgs e)
{
     if (e.ContextMenu.GetContextMenu().MenuItems.RemoveAt("view in system )
     {

     }                
}

1 个答案:

答案 0 :(得分:5)

private void geckoWebBrowser1_ShowContextMenu(object sender, GeckoContextMenuEventArgs e)
  {      
   foreach(MenuItem i in e.ContextMenu.MenuItems)      
   {
     if(i.Text == "View in System Browser")
        e.ContextMenu.MenuItems.Remove(i);
   }
}