protected override void OnKeyDown(KeyEventArgs e)
{
// Cannot process a message for a disposed control
if (!IsDisposed)
{
// If the user pressed tab or shift tab
if ((e.KeyData == Keys.Tab) || (e.KeyData == (Keys.Tab | Keys.Shift)))
{
// If we do not currently contain the focus
if (!_page.ContainsFocus)
{
// Select the appropriate control on the page
TabToNextControl(null, (e.KeyData == Keys.Tab));
// Finished, do not call base class
return;
}
}
}
// Let base class fire events
base.OnKeyDown(e);
}