private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
webBrowser1.Document.Body.MouseDown += Body_MouseDown;
}
void Body_MouseDown(object sender, HtmlElementEventArgs e)
{
switch (e.MouseButtonsPressed)
{
case MouseButtons.Left:
HtmlElement element = webBrowser1.Document.GetElementFromPoint(e.ClientMousePosition);
if (element != null && "img".Equals(element.GetAttribute("type"), StringComparison.OrdinalIgnoreCase))
{
MessageBox.Show("Image Was Clicked");
}
break;
}
}
This is the code I am using but it doesn't seem to work. What am I doing wrong? Is this the correct way?
Any & All Help Is Appreciated.