AccessibleObject.Select Method (AccessibleSelection)


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

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

[<SecurityPermissionAttribute(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)>]
abstract Select : 
        flags:AccessibleSelection -> unit
[<SecurityPermissionAttribute(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)>]
override Select : 
        flags:AccessibleSelection -> unit


Type: System.Windows.Forms.AccessibleSelection

One of the AccessibleSelection values.

Exception Condition

The selection cannot be performed.

Applications can use this method to perform complex selection operations.

The following describes which AccessibleSelection values to specify when calling Select to perform complex selection operations.


Flag Combination

To simulate a click



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


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


To simulate SHIFT + click


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 Select again and specify AccessibleSelection.TakeFocusORAccessibleSelection.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 Select again and specify AccessibleSelection.RemoveSelection on the same object.

Notes to Inheritors:

All objects that can be selected or receive the keyboard focus must support this method.

The following example demonstrates the creation of an accessibility-aware chart control, using the AccessibleObject and Control.ControlAccessibleObject classes to expose accessible information. The control plots two curves along with a legend. The ChartControlAccessibleObject class, which derives from ControlAccessibleObject, is used in the CreateAccessibilityInstance method to provide custom accessible information for the chart control. Since the chart legend is not an actual Control -based control, but instead is drawn by the chart control, it does not have any built-in accessible information. Because of this, the ChartControlAccessibleObject class overrides the GetChild method to return the CurveLegendAccessibleObject that represents accessible information for each part of the legend. When an accessible-aware application uses this control, the control can provide the necessary accessible information.

This code demonstrates shows overriding the Select method. See the AccessibleObject class overview for the complete code example.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top