Control.AccessibilityNotifyClients Method

Definition

Notifies the accessibility client applications of AccessibleEvents.

Overloads

AccessibilityNotifyClients(AccessibleEvents, Int32)

Notifies the accessibility client applications of the specified AccessibleEvents for the specified child control.

AccessibilityNotifyClients(AccessibleEvents, Int32, Int32)

Notifies the accessibility client applications of the specified AccessibleEvents for the specified child control .

AccessibilityNotifyClients(AccessibleEvents, Int32)

Source:
Control.cs
Source:
Control.cs
Source:
Control.cs

Notifies the accessibility client applications of the specified AccessibleEvents for the specified child control.

C#
protected void AccessibilityNotifyClients(System.Windows.Forms.AccessibleEvents accEvent, int childID);
C#
protected internal void AccessibilityNotifyClients(System.Windows.Forms.AccessibleEvents accEvent, int childID);

Parameters

accEvent
AccessibleEvents

The AccessibleEvents to notify the accessibility client applications of.

childID
Int32

The child Control to notify of the accessible event.

Examples

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. 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 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 excerpt demonstrates calling the AccessibilityNotifyClients method. See the AccessibleObject class overview for the complete code example.

C#
    // 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);
            }
        }
    }

Remarks

You must call the Control.ControlAccessibleObject.NotifyClients method for each AccessibleEvents the accessibility client applications are to be notified of. The NotifyClients method is typically called when a property is set or from within an event handler. For example, you might call the NotifyClients method and pass in an AccessibleEvents value of Hide from within the event handler for the Control.VisibleChanged event.

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

AccessibilityNotifyClients(AccessibleEvents, Int32, Int32)

Source:
Control.cs
Source:
Control.cs
Source:
Control.cs

Notifies the accessibility client applications of the specified AccessibleEvents for the specified child control .

C#
protected void AccessibilityNotifyClients(System.Windows.Forms.AccessibleEvents accEvent, int objectID, int childID);

Parameters

accEvent
AccessibleEvents

The AccessibleEvents to notify the accessibility client applications of.

objectID
Int32

The identifier of the AccessibleObject.

childID
Int32

The child Control to notify of the accessible event.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9