void Document_Click(object sender, HtmlElementEventArgs e)
{
if (this.Document != null && this.Document.ActiveElement != null)
{
//if a row is already selected, change it back to unselected
if (lastElement != null)
{
mshtml.IHTMLElement lastElementDom = (IHTMLElement)lastElement.DomElement;
lastElementDom.className = "NotSelected";
}
//Now change the selected row to be highlighted
mshtml.IHTMLElement element = (IHTMLElement) rosterBrowser.Document.ActiveElement.DomElement;
element.className = "Selected";
//cache this element so we can unselect it later
lastElement = rosterBrowser.Document.ActiveElement;
}
}
|