Element Mode Enum
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.
Contains values that specify the type of reference to use when returning UI Automation elements. These values are used in the AutomationElementMode property.
public enum class AutomationElementMode
public enum AutomationElementMode
type AutomationElementMode =
Public Enum AutomationElementMode
Specifies that returned elements have a full reference to the underlying UI.
Specifies that returned elements have no reference to the underlying UI and contain only cached information. This mode might be used, for example, to retrieve the names of items in a list box without obtaining references to the items themselves.
The following example shows how to set the mode on a CacheRequest.
// Set up the request. CacheRequest cacheRequest = new CacheRequest(); // Do not get a full reference to the cached objects, only to their cached properties and patterns. cacheRequest.AutomationElementMode = AutomationElementMode.None;
' Set up the request. Dim cacheRequest As New CacheRequest() ' Do not get a full reference to the cached objects, only to their cached properties and patterns. cacheRequest.AutomationElementMode = AutomationElementMode.None
Full is the default, and specifies that returned elements contain a full reference to the underlying user interface (UI). None specifies that the returned elements have no reference to the underlying UI, and contain only cached information.
Using None can be more efficient when only properties are needed, as it avoids the overhead involved in setting up full references.