Automation::AddAutomationPropertyChangedEventHandler Method (AutomationElement^, TreeScope, AutomationPropertyChangedEventHandler^, array<AutomationProperty^>^)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Registers a method that will handle property-changed events.

Namespace:   System.Windows.Automation
Assembly:  UIAutomationClient (in UIAutomationClient.dll)

static void AddAutomationPropertyChangedEventHandler(
	AutomationElement^ element,
	TreeScope scope,
	AutomationPropertyChangedEventHandler^ eventHandler,
	... array<AutomationProperty^>^ properties


Type: System.Windows.Automation::AutomationElement^

The UI Automation element with which to associate the event handler.

Type: System.Windows.Automation::TreeScope

The scope of events to be handled; that is, whether they are on the element itself, or on its ancestors and children.

Type: System.Windows.Automation::AutomationPropertyChangedEventHandler^

The method to call when the event occurs.

Type: array<System.Windows.Automation::AutomationProperty^>^

The UI Automation properties of interest.

The user interface (UI) item specified by the supplied UI Automation element might not support the properties specified by the properties parameter.

eventHandler can be an instance of the method, or a reference to the method (AddressOf in Visual Basic).

The following example code adds an event handler that listens for a change in the enabled state of a specified element.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 3.0
Return to top