Canguro.Controller.Grid.JointDOFControl.previousFocus C# (CSharp) Method

previousFocus() private method

private previousFocus ( object sender ) : void
sender object
return void
        private void previousFocus(object sender)
        {
            Control previous = null;

            foreach (Control c in flowLayoutPanel1.Controls)
            {
                if (c == sender)
                    break;

                if (c.Visible)
                    previous = c;
            }

            if (previous != null)
                previous.Focus();
            else
                if (flowLayoutPanel1.Controls["spring6"].Visible)
                    flowLayoutPanel1.Controls["spring6"].Focus();
                else
                    flowLayoutPanel1.Controls["comboR3"].Focus();
        }