QueryAccessibilityHelpEventHandler QueryAccessibilityHelpEventHandler QueryAccessibilityHelpEventHandler QueryAccessibilityHelpEventHandler Delegate

定义

表示将处理控件的 QueryAccessibilityHelp 事件的方法。Represents the method that will handle the QueryAccessibilityHelp event of a control.

public delegate void QueryAccessibilityHelpEventHandler(System::Object ^ sender, QueryAccessibilityHelpEventArgs ^ e);
public delegate void QueryAccessibilityHelpEventHandler(object sender, QueryAccessibilityHelpEventArgs e);
type QueryAccessibilityHelpEventHandler = delegate of obj * QueryAccessibilityHelpEventArgs -> unit
Public Delegate Sub QueryAccessibilityHelpEventHandler(sender As Object, e As QueryAccessibilityHelpEventArgs)

参数

sender
Object Object Object Object

事件源。The source of the event.

继承
QueryAccessibilityHelpEventHandlerQueryAccessibilityHelpEventHandlerQueryAccessibilityHelpEventHandlerQueryAccessibilityHelpEventHandler

示例

下面的代码示例演示如何创建一个具有辅助功能的图表控件,并使用AccessibleObjectControl.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. ChartControlAccessibleObject类,该类派生自ControlAccessibleObject,在使用CreateAccessibilityInstance方法以提供自定义访问图表控件的信息。The 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 include any built-in accessible information. 因此,ChartControlAccessibleObject类将重写GetChild方法以返回CurveLegendAccessibleObject,它表示每个部分的图例可访问信息。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.

此代码演示了如何使用QueryAccessibilityHelpEventHandler委托,其QueryAccessibilityHelp事件。This code demonstrates using the QueryAccessibilityHelpEventHandler delegate with the QueryAccessibilityHelp event. 有关完整的代码示例,请参阅AccessibleObjectFor the complete code example, see AccessibleObject.

protected:
   // Overridden to return the custom AccessibleObject
   // for the entire chart.
   virtual AccessibleObject^ CreateAccessibilityInstance() override
   {
      return gcnew ChartControlAccessibleObject( this );
   }
// Overridden to return the custom AccessibleObject 
// for the entire chart.
protected override AccessibleObject CreateAccessibilityInstance() 
{            
    return new ChartControlAccessibleObject(this);
}
' Overridden to return the custom AccessibleObject 
' for the entire chart.
Protected Overrides Function CreateAccessibilityInstance() As AccessibleObject
    Return New ChartControlAccessibleObject(Me)
End Function 

注解

创建 QueryAccessibilityHelpEventHandler 委托时,需要标识将处理该事件的方法。When you create a QueryAccessibilityHelpEventHandler delegate, you identify the method that will handle the event. 若要将事件与事件处理程序关联,请将该委托的一个实例添加到事件中。To associate the event with your event handler, add an instance of the delegate to the event. 除非移除了该委托,否则每当发生该事件时就会调用事件处理程序。The event handler is called whenever the event occurs, unless you remove the delegate. 有关事件处理程序委托的详细信息,请参阅处理和引发事件For more information about event-handler delegates, see Handling and Raising Events.

扩展方法

GetMethodInfo(Delegate) GetMethodInfo(Delegate) GetMethodInfo(Delegate) GetMethodInfo(Delegate)

获取指示指定委托表示的方法的对象。Gets an object that represents the method represented by the specified delegate.

适用于

另请参阅