public virtual Control ActiveControl
{
get
{
return GetFocusedControl(this);
}
set
{
if (!value.Focused)
{
value.Focus();
}
}
}
private Control GetFocusedControl(Control parent)
{
if (parent.Focused)
{
return parent;
}
foreach (Control ctrl in parent.Controls)
{
Control temp = GetFocusedControl(ctrl);
if (temp != null)
{
return temp;
}
}
return null;
}
--
Tim Wilson
.Net Compact Framework MVP
"Joe Hanna" <zo...@msdn.com> wrote in message
news:eAEi2AY3...@TK2MSFTNGP12.phx.gbl...
"Tim Wilson" <Tim_Wilson@[DieSpamDie]Rogers.com> wrote in message
news:O1DBxwY3...@TK2MSFTNGP10.phx.gbl...