AccessibleEvents 枚举

指定由辅助性应用程序报告的事件。

**命名空间:**System.Windows.Forms
**程序集:**System.Windows.Forms(在 system.windows.forms.dll 中)

语法

声明
Public Enumeration AccessibleEvents
用法
Dim instance As AccessibleEvents
public enum AccessibleEvents
public enum class AccessibleEvents
public enum AccessibleEvents
public enum AccessibleEvents

成员

  成员名称 说明
AcceleratorChange 对象的 KeyboardShortcut 属性已更改。服务器应用程序为它们的辅助性对象发送该事件。 
Create 对象已创建。操作系统为下列用户界面元素发送该事件:插入符号、标头控件、列表视图控件、选项卡控件、工具栏控件、树视图控件和窗口对象。服务器应用程序为它们的辅助性对象发送该事件。服务器必须在为父对象发送该对象之前为对象的所有子对象发送该事件。服务器必须确保所有的子对象都已完全创建,并且已准备好在父对象发送事件时接受来自客户端的呼叫。 
DefaultActionChange 对象的 DefaultAction 属性已更改。操作系统为对话框发送该事件。服务器应用程序为它们的辅助性对象发送该事件。因此,服务器应用程序不需要为子对象发送该事件。隐藏的对象具有状态 AccessibleStates.Invisible,而显示的对象没有此状态。AccessibleEvents.Hide 类型的事件指示已设置了状态 AccessibleStates.Invisible。因此,在这种情况下,服务器不需要发送 AccessibleEvents.StateChange 事件。 
DescriptionChange 对象的 Description 属性已更改。服务器应用程序为它们的辅助性对象发送该事件。 
Destroy 对象已损坏。系统为下列用户界面元素发送该事件:插入符号、标头控件、列表视图控件、选项卡控件、工具栏控件、树视图控件和窗口对象。服务器应用程序为它们的辅助性对象发送该事件。可以为子对象发送或不发送该事件。但是,当父对象发送该事件时,客户端可以得出结论,认为对象的所有子级都已损坏。 
Focus 对象已接收键盘焦点。系统为下列用户界面元素发送该事件:列表视图控件、菜单栏、快捷菜单、切换窗口、选项卡控件、树视图控件和窗口对象。服务器应用程序为它们的辅助性对象发送该事件。 
HelpChange 对象的 Help 属性已更改。服务器应用程序为它们的辅助性对象发送该事件。 
Hide 对象已隐藏。系统为下列用户界面元素发送该事件:插入符号和光标。服务器应用程序为它们的辅助性对象发送该事件。为父对象生成该事件时,所有子对象均已隐藏。因此,服务器应用程序不需要为子对象发送该事件。系统并不一贯发送该事件。 
LocationChange 对象已更改位置、形状和大小。系统为下列用户界面元素发送该事件:插入符号和窗口对象。服务器应用程序为它们的辅助性对象发送该事件。该事件是为了响应对象层次结构中已更改的顶级对象(而不是为该对象可能包含的任何子对象)而生成的。例如,如果用户调整窗口的大小,系统就会为此窗口(而不是为菜单栏、标题栏、滚动条或其他同样已发生更改的对象)发送该通知。当父窗口移动时,系统不会为所有非浮动子窗口发送该事件。但是,如果应用程序调整大小的结果是显式调整了子窗口的大小,则系统就会为已调整大小的子窗口发送多个事件。如果对象的 State 属性设置为 AccessibleStates.Floating,则服务器应在对象每次更改位置时发送位置更改事件。如果对象不具有此状态,则服务器应在该对象相对于其父对象发生移动时引发该事件。 
NameChange 对象的 Name 属性已更改。系统为下列用户界面元素发送该事件:复选框、光标、列表视图控件、下压按钮、单选按钮、状态栏控件、树视图控件和窗口对象。服务器应用程序为它们的辅助性对象发送该事件。 
ParentChange 对象具有新的父对象。服务器应用程序为它们的辅助性对象发送该事件。 
Reorder 容器对象已添加、移除其子对象或对其子对象重新排序。系统为下列用户界面元素发送该事件:标头控件、列表视图控件、工具栏控件和窗口对象。服务器应用程序在适当的时候为它们的辅助性对象发送该事件。当用于子窗口的 z 顺序更改时,父窗口也会发送该事件。 
Selection 容器对象内的辅助性对象已被选定。该事件指示单个选择。或者是已在先前不包含任何选定对象的容器中选择了子级,或者是所选内容已从一个子级更改为另一个子级。 
SelectionAdd 容器对象内的项已添至所选内容。系统为下列用户界面元素发送此事件:列表框、列表视图控件和树视图控件。服务器应用程序为它们的辅助性对象发送该事件。此事件指示子对象已添至现有的所选内容。 
SelectionRemove 容器对象内的项已从所选内容中移除。系统为下列用户界面元素发送此事件:列表框、列表视图控件和树视图控件。服务器应用程序为它们的辅助性对象发送该事件。此事件指示子对象已从现有所选内容中移除。 
SelectionWithin 容器对象中发生了多次选择内容更改。系统为列表框发送此事件。服务器应用程序为它们的辅助性对象发送该事件。如果控件中的选定项已发生重大更改,则会发送此事件。此事件通知客户端已发生大量选择内容更改。最好发送若干 SelectionAdd 事件或 SelectionRemove 事件。 
Show 正在显示隐藏对象。系统为下列用户界面元素发送此事件:插入符号、光标和窗口对象。服务器应用程序为它们的辅助性对象发送该事件。客户端可以得出结论:当事件由父对象发送时,所有子对象均已显示。因此,服务器应用程序不需要为子对象发送该事件。 
StateChange 对象的状态已更改。系统为下列用户界面元素发送此事件:复选框、组合框、标头控件、下压按钮、单选按钮、滚动条、工具栏控件、树视图控件、up-down 控件和窗口对象。服务器应用程序为它们的辅助性对象发送该事件。例如,当已按下或松开按钮对象时,或者当正在启用或禁用对象时,可发生状态更改。系统并不一贯发送该事件。 
SystemAlert 警报已生成。每当发生重要的用户界面更改且用户可能需要知道这一更改发生时,服务器应用程序就会发送此事件。系统并不一贯为对话框对象发送该事件。 
SystemCaptureEnd 窗口已丢失鼠标捕获。系统发送该事件;服务器从不发送该事件。 
SystemCaptureStart 正在移动窗口或调整窗口的大小。系统发送该事件;服务器从不发送该事件。 
SystemContextHelpEnd 窗口退出了区分上下文的帮助模式。系统并不一贯发送该事件。 
SystemContextHelpStart 窗口进入了区分上下文的帮助模式。系统并不一贯发送该事件。 
SystemDialogEnd 对话框已关闭。系统不为标准对话框发送该事件。服务器为自定义对话框发送该事件。系统并不一贯发送该事件。 
SystemDialogStart 对话框已显示。系统为标准对话框发送该事件。服务器为自定义对话框发送该事件。系统并不一贯发送该事件。 
SystemDragDropEnd 应用程序将退出拖放模式。支持拖放操作的应用程序必须发送该事件;系统不发送该事件。 
SystemDragDropStart 应用程序将进入拖放模式。支持拖放操作的应用程序必须发送该事件;系统不发送该事件。 
SystemForeground 前景窗口已更改。如果前景窗口更改为同一线程中的另一窗口,系统就会发送该事件。服务器应用程序从不发送该事件。 
SystemMenuEnd 菜单栏中的菜单已关闭。系统为标准菜单发送该事件。服务器为自定义菜单发送该事件。 
SystemMenuPopupEnd 快捷菜单已关闭。系统为标准菜单发送该事件。服务器为自定义菜单发送该事件。当快捷菜单关闭时,客户端会收到此消息,其后紧接着是 SystemMenuEnd 事件。系统并不一贯发送该事件。 
SystemMenuPopupStart 快捷菜单已显示。系统为标准菜单发送该事件。服务器为自定义菜单发送该事件。系统并不一贯发送该事件。 
SystemMenuStart 菜单栏上的菜单项已选定。系统为标准菜单发送该事件。服务器为自定义菜单发送该事件。系统可能会引发多个 MenuEnd 事件,这些事件可能有也可能没有对应的 MenuStart 事件。 
SystemMinimizeEnd 窗口对象已最小化或最大化。系统发送该事件;服务器从不发送该事件。 
SystemMinimizeStart 窗口对象将最小化或最大化。系统发送该事件;服务器从不发送该事件。 
SystemMoveSizeEnd 已完成窗口的移动或大小调整。系统发送该事件;服务器从不发送该事件。 
SystemMoveSizeStart 正在移动窗口或调整窗口的大小。系统发送该事件;服务器从不发送该事件。 
SystemScrollingEnd 滚动条上的滚动已经结束。系统为窗口所附加的滚动条和标准滚动条控件发送该事件。服务器为自定义滚动条发送该事件。 
SystemScrollingStart 滚动条上的滚动已经开始。系统为窗口附加的滚动条和标准滚动条控件发送该事件。服务器为自定义滚动条发送该事件。 
SystemSound 声音已播放。系统会在播放系统声音(例如用于菜单的声音)时发送该事件,即使听不到任何声音。这有可能是由于缺少声音文件或声卡造成的。如果自定义的用户界面元素生成声音,服务器将发送此事件。 
SystemSwitchEnd 用户松开了 Alt+Tab 组合键。系统发送 SwitchEnd 事件;服务器从不发送该事件。如果当用户按下 Alt+Tab 组合键时只有一个应用程序在运行,系统就在没有对应的 SwitchStart 事件的情况下发送 SwitchEnd 事件。 
SystemSwitchStart 用户按下了激活切换窗口的 Alt+Tab 组合键。如果当用户按下 Alt+Tab 组合键时只有一个应用程序在运行,系统就在没有对应的 SwitchStart 事件的情况下引发 SwitchEnd 事件。 
ValueChange 对象的 Value 属性已更改。系统为下列用户界面元素引发 ValueChange 事件:编辑控件、标头控件、热键控件、进度栏控件、滚动条、滑块控件和 up-down 控件。服务器应用程序为它们的辅助性对象发送该事件。 

备注

为响应用户界面的变化,操作系统和辅助功能服务器应用程序会生成辅助功能事件。

AccessibleObjectControl 使用该枚举。

有关具有辅助功能的应用程序的更多信息,请在 MSDN Library 中搜索“Microsoft Active Accessibility”。

示例

下面的代码示例演示了如何创建一个具有辅助功能的图表控件,并使用 AccessibleObjectControl.ControlAccessibleObject 类来公开辅助性信息。该控件绘制两条带有图例的曲线。CreateAccessibilityInstance 方法使用从 ControlAccessibleObject 派生的 ChartControlAccessibleObject 类,为图表控件提供自定义辅助性信息。因为图表图例不是实际的基于 Control 的控件,而是由图表控件绘制的,所以它不提供任何内置的辅助性信息。因此,ChartControlAccessibleObject 类重写 GetChild 方法以返回 CurveLegendAccessibleObject(表示该图例各部分的辅助性信息)。当具有辅助功能的应用程序使用该控件时,该控件能提供必需的辅助性信息。

此示例演示了如何将 AccessibleEvents 枚举与 AccessibilityNotifyClients 方法一起使用。有关完整的代码示例,请参见 AccessibleObject 类概述。

' Gets or sets the location for the curve legend.            
Public Property Location() As Point
    Get
        Return m_location
    End Get
    Set
        m_location = value
        chart.Invalidate()

        ' Notifies the chart of the location change. This is used for
        ' the accessibility information. AccessibleEvents.LocationChange
        ' tells the chart the reason for the notification.
        chart.ExposeAccessibilityNotifyClients(AccessibleEvents.LocationChange, _
                CType(AccessibilityObject, CurveLegendAccessibleObject).ID)
    End Set
End Property

' Gets or sets the Name for the curve legend.            
Public Property Name() As String
    Get
        Return m_name
    End Get
    Set
        If m_name <> value Then
            m_name = value
            chart.Invalidate()

            ' Notifies the chart of the name change. This is used for
            ' the accessibility information. AccessibleEvents.NameChange
            ' tells the chart the reason for the notification. 
            chart.ExposeAccessibilityNotifyClients(AccessibleEvents.NameChange, _
                    CType(AccessibilityObject, CurveLegendAccessibleObject).ID)
        End If
    End Set
End Property

' Gets or sets the Selected state for the curve legend.            
Public Property Selected() As Boolean
    Get
        Return m_selected
    End Get
    Set
        If m_selected <> value Then
            m_selected = value
            chart.Invalidate()

            ' Notifies the chart of the selection value change. This is used for
            ' the accessibility information. The AccessibleEvents value varies
            ' on whether the selection is true (AccessibleEvents.SelectionAdd) or 
            ' false (AccessibleEvents.SelectionRemove). 
            If m_selected Then
                chart.ExposeAccessibilityNotifyClients(AccessibleEvents.SelectionAdd, _
                        CType(AccessibilityObject, CurveLegendAccessibleObject).ID) 
            Else
                chart.ExposeAccessibilityNotifyClients(AccessibleEvents.SelectionRemove, _
                        CType(AccessibilityObject, CurveLegendAccessibleObject).ID) 
            End If
        End If
    End Set
End Property
// Gets or sets the location for the curve legend.
public Point Location
{   
    get {
        return location;
    }
    set {
        location = value;
        chart.Invalidate();

        // Notifies the chart of the location change. This is used for
        // the accessibility information. AccessibleEvents.LocationChange
        // tells the chart the reason for the notification.

        chart.AccessibilityNotifyClients(AccessibleEvents.LocationChange, 
            ((CurveLegendAccessibleObject)AccessibilityObject).ID);
    }
}            
        
// Gets or sets the Name for the curve legend.
public string Name
{   
    get {
        return name;
    }
    set {
        if (name != value) 
        {
            name = value;
            chart.Invalidate();

            // Notifies the chart of the name change. This is used for
            // the accessibility information. AccessibleEvents.NameChange
            // tells the chart the reason for the notification.

            chart.AccessibilityNotifyClients(AccessibleEvents.NameChange, 
                ((CurveLegendAccessibleObject)AccessibilityObject).ID);
        }
    }
}

// Gets or sets the Selected state for the curve legend.
public bool Selected
{   
    get {
        return selected;
    }
    set {
        if (selected != value) 
        {
            selected = value;
            chart.Invalidate();

            // Notifies the chart of the selection value change. This is used for
            // the accessibility information. The AccessibleEvents value depends upon
            // if the selection is true (AccessibleEvents.SelectionAdd) or 
            // false (AccessibleEvents.SelectionRemove).
            chart.AccessibilityNotifyClients(
                selected ? AccessibleEvents.SelectionAdd : AccessibleEvents.SelectionRemove, 
                ((CurveLegendAccessibleObject)AccessibilityObject).ID);
        }
    }
}
   // Gets or sets the location for the curve legend.
   Point get()
   {
      return location;
   }

   void set( Point value )
   {
      location = value;
      chart->Invalidate();
      
      // Notifies the chart of the location change. This is used for
      // the accessibility information. AccessibleEvents::LocationChange
      // tells the chart the reason for the notification.
      chart->AccessibilityNotifyClients( AccessibleEvents::LocationChange, (dynamic_cast<CurveLegendAccessibleObject^>(AccessibilityObject))->ID );
   }

}

property String^ Name 
{

   // Gets or sets the Name for the curve legend.
   String^ get()
   {
      return name;
   }

   void set( String^ value )
   {
      if ( name != value )
      {
         name = value;
         chart->Invalidate();
         
         // Notifies the chart of the name change. This is used for
         // the accessibility information. AccessibleEvents::NameChange
         // tells the chart the reason for the notification.
         chart->AccessibilityNotifyClients( AccessibleEvents::NameChange, (dynamic_cast<CurveLegendAccessibleObject^>(AccessibilityObject))->ID );
      }
   }

}

property bool Selected 
{

   // Gets or sets the Selected state for the curve legend.
   bool get()
   {
      return selected;
   }

   void set( bool value )
   {
      if ( selected != value )
      {
         selected = value;
         chart->Invalidate();
         
         // Notifies the chart of the selection value change. This is used for
         // the accessibility information. The AccessibleEvents value depends upon
         // if the selection is true (AccessibleEvents::SelectionAdd) or
         // false (AccessibleEvents::SelectionRemove).
         chart->AccessibilityNotifyClients( selected ? AccessibleEvents::SelectionAdd : AccessibleEvents::SelectionRemove, (dynamic_cast<CurveLegendAccessibleObject^>(AccessibilityObject))->ID );
      }
   }
// Gets or sets the location for the curve legend.
/** @property 
 */
public Point get_Location()
{
    return location;
} //get_Location

/** @property 
 */
public void set_Location(Point value)
{
    location = value;
    chart.Invalidate();
    // Notifies the chart of the location change. This is used for
    // the accessibility information. AccessibleEvents.LocationChange
    // tells the chart the reason for the notification.
    chart.AccessibilityNotifyClients(AccessibleEvents.LocationChange, 
        ((CurveLegendAccessibleObject)get_AccessibilityObject()).
        get_ID());
} //set_Location

// Gets or sets the Name for the curve legend.
/** @property 
 */
public String get_Name()
{
    return name;
} //get_Name

/** @property 
 */
public void set_Name(String value)
{
    if (!name.Equals(value)) {
        name = value;
        chart.Invalidate();

        // Notifies the chart of the name change. This is used for
        // the accessibility information. AccessibleEvents.NameChange
        // tells the chart the reason for the notification.
        chart.AccessibilityNotifyClients(AccessibleEvents.NameChange,
            ((CurveLegendAccessibleObject)get_AccessibilityObject()).
            get_ID());
    }
} //set_Name

// Gets or sets the Selected state for the curve legend.
/** @property 
 */
public boolean get_Selected()
{
    return selected;
} //get_Selected

/** @property 
 */
public void set_Selected(boolean value)
{
    if (selected != value) {
        selected = value;
        chart.Invalidate();

        // Notifies the chart of the selection value change. 
        // This is used for the accessibility information. 
        // The AccessibleEvents value depends upon
        // if the selection is true (AccessibleEvents.SelectionAdd) or 
        // false (AccessibleEvents.SelectionRemove).
        chart.AccessibilityNotifyClients(selected ? 
            AccessibleEvents.SelectionAdd : 
            AccessibleEvents.SelectionRemove, 
            ((CurveLegendAccessibleObject)get_AccessibilityObject()).
            get_ID());
    }
} //set_Selected

平台

Windows 98、Windows 2000 SP4、Windows CE、Windows Millennium Edition、Windows Mobile for Pocket PC、Windows Mobile for Smartphone、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition

.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求

版本信息

.NET Framework

受以下版本支持:2.0、1.1、1.0

请参见

参考

System.Windows.Forms 命名空间
AccessibleNavigation
AccessibleObject
AccessibleRole
AccessibleSelection
AccessibleStates