If it's for a Web browser control, then this article explains how to do it: https://www.codeproject.com/Articles/32279/How-To-Tell-What-is-Clicked-in-a-WebBrowser-Contro
First off, we need to translate the mouse coordinates on the screen, into a Point object:
Point ScreenCoord = new Point(MousePosition.X, MousePosition.Y);
Now, we must create the coordinates of the browser, based off the coordinates of the screen:
Point BrowserCoord = webBrowser1.PointToClient(ScreenCoord);
Now we can use the WebBrowser documents GetElementFromPoint method to retrieve the element that has been clicked:
HtmlElement elem = webBrowser1.Document.GetElementFromPoint(BrowserCoord);
Now, we can use this element to see what has been clicked:
switch (elem.TagName) {
case "A": //! We have clicked a link
break;
case "IMG": //! We have clicked an image
break;
default: //! This is anywhere else
break;
}