Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

IRawElementProviderSimple.HostRawElementProvider Property

Definition

Namespace:
System.Windows.Automation.Provider
Assembly:
UIAutomationProvider.dll
Assemblies:
UIAutomationProvider.dll, UIAutomationTypes.dll
Assembly:
UIAutomationTypes.dll

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Gets a base provider for this element.

public:
 property System::Windows::Automation::Provider::IRawElementProviderSimple ^ HostRawElementProvider { System::Windows::Automation::Provider::IRawElementProviderSimple ^ get(); };
public System.Windows.Automation.Provider.IRawElementProviderSimple HostRawElementProvider { get; }
member this.HostRawElementProvider : System.Windows.Automation.Provider.IRawElementProviderSimple
Public ReadOnly Property HostRawElementProvider As IRawElementProviderSimple

Property Value

The base provider, or null.

Examples

The following example code shows an implementation of HostRawElementProvider for a fragment root that is hosted in a Windows form.

IRawElementProviderSimple IRawElementProviderSimple.HostRawElementProvider 
{
 get 
 {
 // myHWND is the handle of the window that contains this control.
 return AutomationInteropProvider.HostProviderFromHandle(myHWND);
 }
}
ReadOnly Property HostRawElementProvider() As IRawElementProviderSimple _
 Implements IRawElementProviderSimple.HostRawElementProvider

 Get
 ' myHWND is the handle of the window that contains this control.
 Return AutomationInteropProvider.HostProviderFromHandle(myHWND)
 End Get
End Property

Remarks

This property is the UI Automation provider for the window of a custom control. UI Automation uses this provider in combination with your provider implementation for a control hosted in a window. For example, the run-time identifier of the element is obtained from the host provider.

A host provider must be returned in any of the following cases:

  • This element is the root of a fragment.

  • The element is a simple element such as a pushbutton.

  • The provider is a repositioning placeholder.

In other cases, the property should return null.

Applies to

See also


Feedback

Was this page helpful?