Ben Cowling
Guest
|
Hi
I'm trying to detect when an input (text) control has focus and looses focus. I can hook into the OnFocus/OnFocusOut events and they get fired but the eventObject is always NULL so I don't know the control associated with it. This is the event handler I'm using.
private void adxiehtmlDocEvents1_OnFocus(object sender, object eventObject)
{
mshtml.IHTMLEventObj2 evtObj = (mshtml.IHTMLEventObj2)eventObject;
}
Regards
Ben |
|
Sergey Grischenko
Add-in Express team
Posts: 7233
Joined: 2004-07-05
|
Hi Ben,
Please try the code below:
private void adxiehtmlDocEvents1_OnFocus(object sender, object eventObject)
{
try
{
if (HTMLDocument.activeElement != null)
{
}
}
catch (Exception)
{
}
}
|
|