How to remove contextmenu items from gecko webbrowser control,"i want to disable view source in browser" [closed]

StackOverflow https://stackoverflow.com/questions/20634145

  •  18-09-2022
  •  | 
  •  

Question

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

     }                
}
Was it helpful?

Solution

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);
   }
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top