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

示例

下面的代码示例演示如何创建可访问感知的图表控件, 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 include 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.

此代码演示如何将QueryAccessibilityHelpEventHandler委托QueryAccessibilityHelp与事件一起使用。This code demonstrates using the QueryAccessibilityHelpEventHandler delegate with the QueryAccessibilityHelp event. 有关完整的代码示例, 请AccessibleObject参见。For 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.

适用于

另请参阅