I am having a WebBrowser control and loaded a local image into an IMG tag and set the DocumentText of the WebBrowser as below
<!DOCTYPE HTML>
<meta http-equiv='X-UA-Compatible' content='IE=10' />
<html lang='en'>
<body style='margin: 0; overflow: hidden;'>
<img Width = 1269 Height = 1600 src='C:\Users\ADMIN\Desktop\p41.png'></img>
</body>
</html>
It is loading perfectly fine. For some reason, I want to invoke the context menu of the image and click one of the context menu items programmatically
(say for example "Copy" - though I don't want this - I can choose any item in the menu). I don't know how to achieve this. When I tried to iterate the context menu of the browser control, I am getting System.NullReferenceException: 'Object reference not set to an instance of an object.'
as I have not placed any ContextMenu control in the form, since I wanted to access the WebBrowser's inbuilt context menu. Is this achievable ?
Or is there a way to get the code (which IE does) for each of its menu item, so I can directly call that - atleast for "Save picture as..." and "Copy"
Please Note: I do not want to use the "SRC" attribute to be part of any solution as I do not want that as you see I am the one forming the HTML tag with that. Hence I know that.
Please find the screenshot below