System.Windows.Forms.AccessibleObject.Select Method

Modifies the selection or moves the keyboard focus of the accessible object.

Syntax

public virtual void Select (AccessibleSelection flags)

Parameters

flags
One of the System.Windows.Forms.AccessibleSelection values.

Remarks

Applications can use this method to perform complex selection operations.

The following describes which System.Windows.Forms.AccessibleSelection values to specify when calling AccessibleObject.Select(AccessibleSelection) to perform complex selection operations.

To simulate a click

AccessibleSelection.TakeFocus OR AccessibleSelection.TakeSelection

This combination will not select the desired control if called from within your own application. It will have the desired effect, however, if called from an external application.
To select a target item by simulating CTRL + click

AccessibleSelection.TakeFocus OR AccessibleSelection.AddSelection

To cancel selection of a target item by simulating CTRL + click

AccessibleSelection.TakeFocus OR AccessibleSelection.RemoveSelection

To simulate SHIFT + click

AccessibleSelection.TakeFocus OR AccessibleSelection.ExtendSelection

To select a range of objects and put focus on the last object

Specify AccessibleSelection.TakeFocus on the starting object to set the selection anchor. Then call AccessibleObject.Select(AccessibleSelection) again and specify AccessibleSelection.TakeFocus OR AccessibleSelection.ExtendSelection on the last object.

To deselect all objects

Specify AccessibleSelection.TakeSelection on any object. This flag deselects all selected objects except the one just selected. Then call AccessibleObject.Select(AccessibleSelection) again and specify AccessibleSelection.RemoveSelection on the same object.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0