public void FocusOn(IMyControl control) { if (Controls.IndexOf(control) != m_focusedControl) { if (m_focusedControl != -1) { Controls[m_focusedControl].LostFocus(); } m_focusedControl = Controls.IndexOf(control); control.GotFocus(); } }