Greg,
I'm pretty certain that the main Form cannot get focus as long as there are
controls that can get the focus. However, you can use the "Activated" event
to know when the form has been entered/reentered after you leave it. That
might be what you need. This has changed in .NET as it gets fired more often
now. Basically it gets fired whenever you go away from the form and come
back to it, either from inside or from outside the application.
HTH
WhiteWizare (aka Gandalf)
MCSD.NET, MCAD, MCT
"Greg" wrote:
Thanks for that. I've tried it, but this is only fired when the focus
is lost to another control, not the form. I need to know when the main
form receives focus, as well as any controls. However, due to
architectural constraints, I can't add any code to the main form - so
the coding has to be done within my derived datagrid.
Getting a reference to the main form and adding feedback for gotfocus
doesnt work either!
Thanks again.
Greg.