void SetFocus(Control control) { _focus = control; Win32.InvalidateRect(Handle, IntPtr.Zero, false); AutomationInteropProvider.RaiseAutomationEvent( AutomationElement.AutomationFocusChangedEvent, this, new AutomationFocusChangedEventArgs(0, _focus.AutomationPeer.RuntimeID) ); }
public Control GetSibling(Control from, int delta, bool wrap=false) { int index = _controls.IndexOf(from); if (index < 0) return null; index += delta; if (index < 0) { if (wrap) index = _controls.Count - 1; else return null; } if (index >= _controls.Count) { if (wrap) index = 0; else return null; } return _controls[index]; }