Click here to Skip to main content
15,881,832 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am building A Web-Browser Control and can't seem to solve this problem i have tried googling the problem as well as here on CP. Any suggestions or pointers in the right direction would be appreciated.
Posted

try using
C++
document.activeElement.href
 
Share this answer
 
Comments
charles henington 23-Jun-11 17:44pm    
There is no document.ActiveElement.href in HtmlDocument, Perhaps in Javascript Im not sure. I havent worked with Javascript would you perhaps know how i would go about using javascript to return the value?
charles henington 24-Jun-11 17:35pm    
although this was not the correct answer that i was looking for the href part of your solution did point me in the right direction So I gave you a 4. thank you for the help and for the correct way using the HtmlDocument please see my solution below.
The Solution which I figured out finally was to create a MouseOver event from the ActiveElement
C#
Element.MouseOver += new HtmlElementEventHandler(Element_MouseOver);
Now that we have this in place from the HtmlElementEventArgs we can get the active url like this
C#
string link = e.ToElement.GetAttribute("href");
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900