AccessibleRole AccessibleRole AccessibleRole AccessibleRole Enum

定义

指定表示辅助性对象的可能角色的值。Specifies values representing possible roles for an accessible object.

public enum class AccessibleRole
public enum AccessibleRole
type AccessibleRole = 
Public Enum AccessibleRole
继承
AccessibleRoleAccessibleRoleAccessibleRoleAccessibleRole

字段

Alert Alert Alert Alert 8

可以通知给用户的有关警告或条件。An alert or condition that you can notify a user about. 只将此角色用于体现警告但不与其他用户界面元素(例如,消息框、图形、文本或声音)关联的对象。Use this role only for objects that embody an alert but are not associated with another user interface element, such as a message box, graphic, text, or sound.

Animation Animation Animation Animation 54

动画控件,它包含随时间推移而不断变化的内容,例如,显示一系列位图帧的控件,就像幻灯片一样。An animation control, which contains content that is changing over time, such as a control that displays a series of bitmap frames, like a filmstrip. 动画控件通常在复制文件或者执行其他耗时任务时显示。Animation controls are usually displayed when files are being copied, or when some other time-consuming task is being performed.

Application Application Application Application 14

应用程序的主窗口。The main window for an application.

Border Border Border Border 19

窗口边框。A window border. 整个边框由单个对象表示,而不是每个边分别由单独的对象表示。The entire border is represented by a single object, rather than by separate objects for each side.

ButtonDropDown ButtonDropDown ButtonDropDown ButtonDropDown 56

下拉项列表的按钮。A button that drops down a list of items.

ButtonDropDownGrid ButtonDropDownGrid ButtonDropDownGrid ButtonDropDownGrid 58

下拉网格的按钮。A button that drops down a grid.

ButtonMenu ButtonMenu ButtonMenu ButtonMenu 57

下拉菜单的按钮。A button that drops down a menu.

Caret Caret Caret Caret 7

插入符号是闪烁的行、块或位图,在窗口的工作区中标记插入点位置。A caret, which is a flashing line, block, or bitmap that marks the location of the insertion point in a window's client area.

Cell Cell Cell Cell 29

表中的单元格。A cell within a table.

Character Character Character Character 32

类似于卡通画的图形对象(例如“Microsoft Office 助手”),显示该图形对象通常是为了向应用程序的用户提供帮助。A cartoon-like graphic object, such as Microsoft Office Assistant, which is typically displayed to provide help to users of an application.

Chart Chart Chart Chart 17

用于表示数据的图形图像。A graphical image used to represent data.

CheckButton CheckButton CheckButton CheckButton 44

复选框控件,是可独立于其他选项而打开或关闭的选项。A check box control, which is an option that can be turned on or off independent of other options.

Client Client Client Client 10

窗口的用户区域。A window's user area.

Clock Clock Clock Clock 61

显示时间的控件。A control that displays the time.

Column Column Column Column 27

表中的一列单元格。A column of cells within a table.

ColumnHeader ColumnHeader ColumnHeader ColumnHeader 25

列标头,它为表中的列提供可视标签。A column header, which provides a visual label for a column in a table.

ComboBox ComboBox ComboBox ComboBox 46

组合框,它是带有关联列表框的编辑控件,可提供一组预定义选项。A combo box, which is an edit control with an associated list box that provides a set of predefined choices.

Cursor Cursor Cursor Cursor 6

鼠标指针。A mouse pointer.

Default Default Default Default -1

系统提供的角色。A system-provided role.

Diagram Diagram Diagram Diagram 53

用于关系图数据的图形图像。A graphical image used to diagram data.

Dial Dial Dial Dial 49

刻度盘或旋钮。A dial or knob. 它也可以像速度计一样是只读对象。This can also be a read-only object, like a speedometer.

Dialog Dialog Dialog Dialog 18

对话框或消息框。A dialog box or message box.

Document Document Document Document 15

文档窗口,它总是包含在应用程序窗口中。A document window, which is always contained within an application window. 此角色只应用于多文档界面 (MDI) 窗口,且引用包含了 MDI 标题栏的对象。This role applies only to multiple-document interface (MDI) windows and refers to an object that contains the MDI title bar.

DropList DropList DropList DropList 47

下拉列表框。A drop-down list box. 此控件显示一个项,并允许用户从可供选择的选项的列表中显示和选择另一个项。This control shows one item and allows the user to display and select another from a list of alternative choices.

Equation Equation Equation Equation 55

数学公式。A mathematical equation.

Graphic Graphic Graphic Graphic 40

图片。A picture.

Grip Grip Grip Grip 4

特殊的鼠标指针,它允许用户操作窗口这样的用户界面元素。A special mouse pointer, which allows a user to manipulate user interface elements such as a window. 例如,用户可以单击并拖动窗口右下角的大小调整手柄来调整其大小。For example, a user can click and drag a sizing grip in the lower-right corner of a window to resize it.

Grouping Grouping Grouping Grouping 20

以逻辑方式分组的对象。The objects grouped in a logical manner. 分组对象及其所包含对象之间可以是父子关系。There can be a parent-child relationship between the grouping object and the objects it contains.

HelpBalloon HelpBalloon HelpBalloon HelpBalloon 31

以“工具提示”或“帮助”气球的形式显示的帮助,包含用户可单击打开自定义帮助主题的按钮和标签。A Help display in the form of a ToolTip or Help balloon, which contains buttons and labels that users can click to open custom Help topics.

HotkeyField HotkeyField HotkeyField HotkeyField 50

热键字段,它允许用户输入要作为热键(使用户可以迅速执行操作)使用的键击组合或键击序列。A hot-key field that allows the user to enter a combination or sequence of keystrokes to be used as a hot key, which enables users to perform an action quickly. 热键控件显示由用户输入的键击,并确保用户选择有效的组合键。A hot-key control displays the keystrokes entered by the user and ensures that the user selects a valid key combination.

Indicator Indicator Indicator Indicator 39

指向当前项的指示器,例如指针图形。An indicator, such as a pointer graphic, that points to the current item.

IpAddress IpAddress IpAddress IpAddress 63

为输入 Internet 协议 (IP) 地址而设计的控件。A control designed for entering Internet Protocol (IP) addresses.

30

链接,该链接是源文档与目标文档之间的连接。A link, which is a connection between a source document and a destination document. 该对象的外观可能像文本或图形,但其操作像按钮。This object might look like text or a graphic, but it acts like a button.

List List List List 33

列表框,允许用户选择一项或多项。A list box, which allows the user to select one or more items.

ListItem ListItem ListItem ListItem 34

列表框或组合框的列表部分、下拉列表框,或者下拉组合框中的项。An item in a list box or the list portion of a combo box, drop-down list box, or drop-down combo box.

MenuBar MenuBar MenuBar MenuBar 2

菜单栏,通常位于窗口的标题栏下面,用户可从中选择菜单。A menu bar, usually beneath the title bar of a window, from which users can select menus.

MenuItem MenuItem MenuItem MenuItem 12

菜单项,它是菜单中用户可以选择以执行命令、选择选项或显示另一个菜单的项。A menu item, which is an entry in a menu that a user can choose to carry out a command, select an option, or display another menu. 就功能而言,菜单项可等效于下压按钮、单选按钮、复选框或菜单。Functionally, a menu item can be equivalent to a push button, radio button, check box, or menu.

MenuPopup MenuPopup MenuPopup MenuPopup 11

菜单,用于提供选项列表,用户可从中进行选择,以执行操作。A menu, which presents a list of options from which the user can make a selection to perform an action. 所有菜单类型都必须具有这种作用,包括通过从菜单栏中选择而显示的下拉菜单,以及在单击鼠标右键时显示的快捷菜单。All menu types must have this role, including drop-down menus that are displayed by selection from a menu bar, and shortcut menus that are displayed when the right mouse button is clicked.

None None None None 0

没有角色。No role.

Outline Outline Outline Outline 35

大纲或树结构(例如树视图控件),显示层次列表,且通常允许用户扩展和折叠分支。An outline or tree structure, such as a tree view control, which displays a hierarchical list and usually allows the user to expand and collapse branches.

OutlineButton OutlineButton OutlineButton OutlineButton 64

可以像大纲项一样导航的控件。A control that navigates like an outline item.

OutlineItem OutlineItem OutlineItem OutlineItem 36

大纲或树结构中的项。An item in an outline or tree structure.

PageTab PageTab PageTab PageTab 37

属性页,允许用户查看页的特性,例如页的标题、该页是否为主页,或者该页是否已被修改。A property page that allows a user to view the attributes for a page, such as the page's title, whether it is a home page, or whether the page has been modified. 通常,该控件的唯一子级是包含了关联页内容的分组对象。Normally, the only child of this control is a grouped object that contains the contents of the associated page.

PageTabList PageTabList PageTabList PageTabList 60

页标签控件的容器。A container of page tab controls.

Pane Pane Pane Pane 16

可用于显示信息的框架中的单独区域、拆分的文档窗口或状态栏的矩形区域。A separate area in a frame, a split document window, or a rectangular area of the status bar that can be used to display information. 用户可以在窗格之间以及当前窗格的内容中定位,但不能在不同窗格中的项之间定位。Users can navigate between panes and within the contents of the current pane, but cannot navigate between items in different panes. 因此,窗格表示低于框架窗口或文档、但高于单个控件的分组级别。Thus, panes represent a level of grouping lower than frame windows or documents, but above individual controls. 通常,根据上下文的不同,用户可通过按 Tab、F6 或 Ctrl+Tab 在窗格之间定位。Typically, the user navigates between panes by pressing TAB, F6, or CTRL+TAB, depending on the context.

ProgressBar ProgressBar ProgressBar ProgressBar 48

进度栏,它通过在一个水平矩形内显示彩色线来指示漫长操作的进度。A progress bar, which indicates the progress of a lengthy operation by displaying colored lines inside a horizontal rectangle. 彩色线长度与矩形长度之比对应于已完成操作的百分比。The length of the lines in relation to the length of the rectangle corresponds to the percentage of the operation that is complete. 该控件不需要用户输入。This control does not take user input.

PropertyPage PropertyPage PropertyPage PropertyPage 38

属性页,是一个对话框,用于控制对象(例如,文件或资源)的外观和行为。A property page, which is a dialog box that controls the appearance and the behavior of an object, such as a file or resource. 属性页的外观因其用途而异。A property page's appearance differs according to its purpose.

PushButton PushButton PushButton PushButton 43

下压按钮控件,它是用户可以打开或关闭的小型矩形控件。A push button control, which is a small rectangular control that a user can turn on or off. 下压按钮,也称作命令按钮,它处于关闭状态(默认)时,其外观凸起,而当它处于打开状态时,其外观凹陷。A push button, also known as a command button, has a raised appearance in its default off state and a sunken appearance when it is turned on.

RadioButton RadioButton RadioButton RadioButton 45

选项按钮,也称作单选按钮。An option button, also known as a radio button. 假定共享具有该特性的单个父级的所有对象都是单个互相排斥组的组成部分。All objects sharing a single parent that have this attribute are assumed to be part of a single mutually exclusive group. 必要时,您可以使用分组对象将选项按钮分成单独的组。You can use grouped objects to divide option buttons into separate groups when necessary.

Row Row Row Row 28

表中的一行单元格。A row of cells within a table.

RowHeader RowHeader RowHeader RowHeader 26

行标题,为表行提供可视标签。A row header, which provides a visual label for a table row.

ScrollBar ScrollBar ScrollBar ScrollBar 3

垂直或水平滚动条,该滚动条可以是工作区的一部分,也可以在控件中使用。A vertical or horizontal scroll bar, which can be either part of the client area or used in a control.

Separator Separator Separator Separator 21

在视觉上分为两个区域的空间,例如,分隔符菜单项或在窗口中分隔所拆分窗格的分隔条。A space divided visually into two regions, such as a separator menu item or a separator dividing split panes within a window.

Slider Slider Slider Slider 51

一种控件(有时称为跟踪条),允许用户通过移动滑块在最小值和最大值之间以给定的增量调整设置。A control, sometimes called a trackbar, that enables a user to adjust a setting in given increments between minimum and maximum values by moving a slider. Windows 操作系统中的音量控制是滑块控件。The volume controls in the Windows operating system are slider controls.

Sound Sound Sound Sound 5

系统声音,与各种系统事件相关联。A system sound, which is associated with various system events.

SpinButton SpinButton SpinButton SpinButton 52

数字显示框,也称作 up-down 控件,包含一对箭头按钮。A spin box, also known as an up-down control, which contains a pair of arrow buttons. 用户用鼠标单击箭头按钮可增加或减小值。A user clicks the arrow buttons with a mouse to increment or decrement a value. 数值调节钮控件经常与配套控件一起使用,被称为合作者窗口,其中显示当前值。A spin button control is most often used with a companion control, called a buddy window, where the current value is displayed.

SplitButton SplitButton SplitButton SplitButton 62

具有直接与其相邻的下拉列表图标的工具栏按钮。A toolbar button that has a drop-down list icon directly adjacent to the button.

StaticText StaticText StaticText StaticText 41

用于对话框中其他控件或说明的只读文本,例如标签中的文本。The read-only text, such as in a label, for other controls or instructions in a dialog box. 无法修改或选择静态文本。Static text cannot be modified or selected.

StatusBar StatusBar StatusBar StatusBar 23

状态栏,它是这样一种区域:通常位于应用程序窗口的底端,其中显示有关当前操作、应用程序状态或选定对象的信息。A status bar, which is an area typically at the bottom of an application window that displays information about the current operation, state of the application, or selected object. 状态栏可以有多个区域,在状态栏中显示不同类型的信息,例如,对当前所选菜单命令的解释。The status bar can have multiple fields that display different kinds of information, such as an explanation of the currently selected menu command in the status bar.

Table Table Table Table 24

包含单元格行和单元格列(还可包含行标头和列标头)的表。A table containing rows and columns of cells and, optionally, row headers and column headers.

Text Text Text Text 42

可编辑的或只读的可选择文本。The selectable text that can be editable or read-only.

TitleBar TitleBar TitleBar TitleBar 1

窗口的标题或标题栏。A title or caption bar for a window.

ToolBar ToolBar ToolBar ToolBar 22

工具栏,它是使常用功能易于使用的控件组合。A toolbar, which is a grouping of controls that provide easy access to frequently used features.

ToolTip ToolTip ToolTip ToolTip 13

工具提示,它是一个小型矩形弹出式窗口,其中显示按钮用途的简短说明。A tool tip, which is a small rectangular pop-up window that displays a brief description of the purpose of a button.

WhiteSpace WhiteSpace WhiteSpace WhiteSpace 59

其他对象之间的空白区域。A blank space between other objects.

Window Window Window Window 9

窗口框架,它通常包含子对象,例如,窗口中通常包含的标题栏、客户端和其他对象。A window frame, which usually contains child objects such as a title bar, client, and other objects typically contained in a window.

示例

下面的代码示例演示如何创建可访问感知的图表控件, AccessibleObject并使用和Control.ControlAccessibleObject类公开可访问的信息。The following code 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. CreateAccessibilityInstanceChartControlAccessibleObject 派生的类在方法中用于为图表控件提供自定义的可访问信息。ControlAccessibleObjectThe ChartControlAccessibleObject class, which derives from ControlAccessibleObject, is used in the CreateAccessibilityInstance method to provide custom accessible information for the chart control. 因为图表图例不是实际Control的控件, 而是由图表控件绘制的, 所以它不是任何内置的可访问信息。Because the chart legend is not an actual Control -based control, but instead is drawn by the chart control, it does not any built-in accessible information. 因此, ChartControlAccessibleObjectCurveLegendAccessibleObjectGetChild重写方法以返回, 该方法表示图例的每个部分的可访问信息。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.

此示例演示如何将AccessibleRole枚举Role与属性一起使用。This example demonstrates using the AccessibleRole enumeration with the Role property. 有关完整的代码示例, 请参阅类概述。AccessibleObjectSee the AccessibleObject class overview for the complete code example.

// Inner class ChartControlAccessibleObject represents accessible information associated with the ChartControl.
// The ChartControlAccessibleObject is returned in the ChartControl::CreateAccessibilityInstance .
ref class ChartControlAccessibleObject: public ControlAccessibleObject
{
private:
   ChartControl^ chartControl;

public:
   ChartControlAccessibleObject( ChartControl^ ctrl )
      : ControlAccessibleObject( ctrl )
   {
      chartControl = ctrl;
   }


   property System::Windows::Forms::AccessibleRole Role 
   {

      // Gets the role for the Chart. This is used by accessibility programs.
      virtual System::Windows::Forms::AccessibleRole get() override
      {
         return ::AccessibleRole::Chart;
      }

   }

   property AccessibleStates State 
   {

      // Gets the state for the Chart. This is used by accessibility programs.
      virtual AccessibleStates get() override
      {
         return AccessibleStates::ReadOnly;
      }

   }

   // The CurveLegend objects are "child" controls in terms of accessibility so
   // return the number of ChartLengend objects.
   virtual int GetChildCount() override
   {
      return chartControl->Legends->Length;
   }


   // Gets the Accessibility object of the child CurveLegend idetified by index.
   virtual AccessibleObject^ GetChild( int index ) override
   {
      if ( index >= 0 && index < chartControl->Legends->Length )
      {
         return chartControl->Legends[ index ]->AccessibilityObject;
      }

      return nullptr;
   }


internal:

   // Helper function that is used by the CurveLegend's accessibility object
   // to navigate between sibiling controls. Specifically, this function is used in
   // the CurveLegend::CurveLegendAccessibleObject.Navigate function.
   AccessibleObject^ NavigateFromChild( CurveLegend::CurveLegendAccessibleObject^ child, AccessibleNavigation navdir )
   {
      switch ( navdir )
      {
         case AccessibleNavigation::Down:
         case AccessibleNavigation::Next:
            return GetChild( child->ID + 1 );

         case AccessibleNavigation::Up:
         case AccessibleNavigation::Previous:
            return GetChild( child->ID - 1 );
      }
      return nullptr;
   }


   // Helper function that is used by the CurveLegend's accessibility object
   // to select a specific CurveLegend control. Specifically, this function is used
   // in the CurveLegend::CurveLegendAccessibleObject.Select function.
   void SelectChild( CurveLegend::CurveLegendAccessibleObject^ child, AccessibleSelection selection )
   {
      int childID = child->ID;
      
      // Determine which selection action should occur, based on the
      // AccessibleSelection value.
      if ( (selection & AccessibleSelection::TakeSelection) != (AccessibleSelection)0 )
      {
         for ( int i = 0; i < chartControl->Legends->Length; i++ )
         {
            if ( i == childID )
            {
               chartControl->Legends[ i ]->Selected = true;
            }
            else
            {
               chartControl->Legends[ i ]->Selected = false;
            }

         }
         
         // AccessibleSelection->AddSelection means that the CurveLegend will be selected.
         if ( (selection & AccessibleSelection::AddSelection) != (AccessibleSelection)0 )
         {
            chartControl->Legends[ childID ]->Selected = true;
         }
         
         // AccessibleSelection->AddSelection means that the CurveLegend will be unselected.
         if ( (selection & AccessibleSelection::RemoveSelection) != (AccessibleSelection)0 )
         {
            chartControl->Legends[ childID ]->Selected = false;
         }
      }
   }

};

// class ChartControlAccessibleObject
// Inner class ChartControlAccessibleObject represents accessible information associated with the ChartControl.
// The ChartControlAccessibleObject is returned in the ChartControl.CreateAccessibilityInstance override.
public class ChartControlAccessibleObject : ControlAccessibleObject
{
    ChartControl chartControl;

    public ChartControlAccessibleObject(ChartControl ctrl) : base(ctrl) 
    {
        chartControl = ctrl;
    }

    // Gets the role for the Chart. This is used by accessibility programs.
    public override AccessibleRole Role
    {  
        get {
            return AccessibleRole.Chart;
        }
    }

    // Gets the state for the Chart. This is used by accessibility programs.
    public override AccessibleStates State
    {  
        get {                    
            return AccessibleStates.ReadOnly;
        }
    }

    // The CurveLegend objects are "child" controls in terms of accessibility so 
    // return the number of ChartLengend objects.
    public override int GetChildCount()
    {  
        return chartControl.Legends.Length;
    }

    // Gets the Accessibility object of the child CurveLegend idetified by index.
    public override AccessibleObject GetChild(int index)
    {  
        if (index >= 0 && index < chartControl.Legends.Length) {
            return chartControl.Legends[index].AccessibilityObject;
        }                
        return null;
    }

    // Helper function that is used by the CurveLegend's accessibility object
    // to navigate between sibiling controls. Specifically, this function is used in
    // the CurveLegend.CurveLegendAccessibleObject.Navigate function.
    internal AccessibleObject NavigateFromChild(CurveLegend.CurveLegendAccessibleObject child, 
                                                AccessibleNavigation navdir) 
    {  
        switch(navdir) {
            case AccessibleNavigation.Down:
            case AccessibleNavigation.Next:
                return GetChild(child.ID + 1);
                
            case AccessibleNavigation.Up:
            case AccessibleNavigation.Previous:
                return GetChild(child.ID - 1);                        
        }
        return null;
    }

    // Helper function that is used by the CurveLegend's accessibility object
    // to select a specific CurveLegend control. Specifically, this function is used
    // in the CurveLegend.CurveLegendAccessibleObject.Select function.
    internal void SelectChild(CurveLegend.CurveLegendAccessibleObject child, AccessibleSelection selection) 
    {   
        int childID = child.ID;

        // Determine which selection action should occur, based on the
        // AccessibleSelection value.
        if ((selection & AccessibleSelection.TakeSelection) != 0) {
            for(int i = 0; i < chartControl.Legends.Length; i++) {
                if (i == childID) {
                    chartControl.Legends[i].Selected = true;                        
                } else {
                    chartControl.Legends[i].Selected = false;
                }
            }

            // AccessibleSelection.AddSelection means that the CurveLegend will be selected.
            if ((selection & AccessibleSelection.AddSelection) != 0) {
                chartControl.Legends[childID].Selected = true;                        
            }

            // AccessibleSelection.AddSelection means that the CurveLegend will be unselected.
            if ((selection & AccessibleSelection.RemoveSelection) != 0) {
                chartControl.Legends[childID].Selected = false;                        
            }
        }            
    }
}
' Inner Class ChartControlAccessibleObject represents accessible information 
' associated with the ChartControl.
' The ChartControlAccessibleObject is returned in the         ' ChartControl.CreateAccessibilityInstance override.
Public Class ChartControlAccessibleObject
    Inherits Control.ControlAccessibleObject

    Private chartControl As ChartControl
    
    Public Sub New(ctrl As ChartControl)
        MyBase.New(ctrl)
        chartControl = ctrl
    End Sub
    
    ' Get the role for the Chart. This is used by accessibility programs.            
    Public Overrides ReadOnly Property Role() As AccessibleRole
        Get
            Return System.Windows.Forms.AccessibleRole.Chart
        End Get
    End Property
    
    ' Get the state for the Chart. This is used by accessibility programs.            
    Public Overrides ReadOnly Property State() As AccessibleStates
        Get
            Return AccessibleStates.ReadOnly
        End Get
    End Property                        
    
    ' The CurveLegend objects are "child" controls in terms of accessibility so 
    ' return the number of ChartLengend objects.            
    Public Overrides Function GetChildCount() As Integer
        Return chartControl.Legends.Length
    End Function 
    
    ' Get the Accessibility object of the child CurveLegend idetified by index.
    Public Overrides Function GetChild(index As Integer) As AccessibleObject
        If index >= 0 And index < chartControl.Legends.Length Then
            Return chartControl.Legends(index).AccessibilityObject
        End If
        Return Nothing
    End Function 
    
    ' Helper function that is used by the CurveLegend's accessibility object
    ' to navigate between sibiling controls. Specifically, this function is used in
    ' the CurveLegend.CurveLegendAccessibleObject.Navigate function.
    Friend Function NavigateFromChild(child As CurveLegend.CurveLegendAccessibleObject, _
                                    navdir As AccessibleNavigation) As AccessibleObject
        Select Case navdir
            Case AccessibleNavigation.Down, AccessibleNavigation.Next
                    Return GetChild(child.ID + 1)
            
            Case AccessibleNavigation.Up, AccessibleNavigation.Previous
                    Return GetChild(child.ID - 1)
        End Select
        Return Nothing
    End Function            

    ' Helper function that is used by the CurveLegend's accessibility object
    ' to select a specific CurveLegend control. Specifically, this function is used 
    ' in the CurveLegend.CurveLegendAccessibleObject.Select function.            
    Friend Sub SelectChild(child As CurveLegend.CurveLegendAccessibleObject, selection As AccessibleSelection)
        Dim childID As Integer = child.ID
        
        ' Determine which selection action should occur, based on the
        ' AccessibleSelection value.
        If (selection And AccessibleSelection.TakeSelection) <> 0 Then
            Dim i As Integer
            For i = 0 To chartControl.Legends.Length - 1
                If i = childID Then
                    chartControl.Legends(i).Selected = True
                Else
                    chartControl.Legends(i).Selected = False
                End If
            Next i
            
            ' AccessibleSelection.AddSelection means that the CurveLegend will be selected.
            If (selection And AccessibleSelection.AddSelection) <> 0 Then
                chartControl.Legends(childID).Selected = True
            End If

            ' AccessibleSelection.AddSelection means that the CurveLegend will be unselected.                    
            If (selection And AccessibleSelection.RemoveSelection) <> 0 Then
                chartControl.Legends(childID).Selected = False
            End If
        End If
    End Sub
End Class

注解

对象的角色描述对象的功能, 由辅助功能应用程序使用。The role of the object describes the function of the object and is used by accessibility applications.

此枚举由AccessibleObject和使用Control.AccessibleRoleThis enumeration is used by AccessibleObject and Control.AccessibleRole

有关辅助功能应用程序的其他信息, 请在 Microsoft Developer Network (MSDN) 库中搜索 "Microsoft Active Accessibility"。For additional information about the accessibility application, search for "Microsoft Active Accessibility" in the Microsoft Developer Network (MSDN) library.

适用于

另请参阅