internal override void SetFocus() { AccessibleObject focusedItem = GetFocused(); focusedItem.RaiseAutomationEvent(UiaCore.UIA.AutomationFocusChangedEventId); focusedItem.SetFocus(); }
internal override void SetFocus() { AccessibleObject focusedItem = GetFocused(); focusedItem.RaiseAutomationEvent(NativeMethods.UIA_AutomationFocusChangedEventId); focusedItem.SetFocus(); }
internal unsafe override void SelectItem() { if (_owningPropertyGrid is null || !_owningPropertyGrid.IsHandleCreated) { return; } bool initialState = _owningPropertyGridToolStripButton.Checked; _owningPropertyGridToolStripButton.PerformClick(); // This code is required to simulate the behavior in 4.7.1. When we call "Toggle" method on an already // checked button, the focus switches to the ToolStrip. If the button was not checked before the call, // then the focus is switched to the table with properties. AccessibleObject?focusedAccessibleObject = initialState ? _owningPropertyGridToolStripButton.Parent?.AccessibilityObject : _owningPropertyGridToolStripButton._owningPropertyGrid.GridViewAccessibleObject.GetFocused(); focusedAccessibleObject?.RaiseAutomationEvent(UiaCore.UIA.AutomationFocusChangedEventId); }