protected virtual bool ProcessTabKey(bool forward)
{
if (forward)
{
if ((this.Focused && !this.Collapsed) || this.Items.Count == 0)
{
return base.SelectNextControl(this, forward, true, true, false);
}
else
{
return this.Parent.SelectNextControl(this.Items[this.Items.Count-1], forward, true, true, false);
}
}
else
{
if (this.Focused || this.Items.Count == 0 || this.Collapsed)
{
return this.Parent.SelectNextControl(this, forward, true, true, false);
}
else
{
this.Select();
return this.Focused;
}
}
}