Version

FindElementInDirection(FindDirection,UIElement) Method

Find the closest element to this one in the element's control element.
Syntax
'Declaration
 
Public Overloads Shared Function FindElementInDirection( _
   ByVal direction As FindDirection, _
   ByVal startingElement As UIElement _
) As UIElement
public static UIElement FindElementInDirection( 
   FindDirection direction,
   UIElement startingElement
)

Parameters

direction
The direction in which the find operation should look.
startingElement
The starting element where the find operation originates.

Return Value

The best matching element found, or null if no element was found.
Remarks

The distance between elements is measured only in the direction of the search operation.

The element found must overlap this element when moving in the direction of the find operation.

The element found must also be completely past this element in the direction of the find operation.

If there are two elements found with the same distance to this element, the element whose edge is closest to the center line drawn thourgh this element in the direction of the find operation is chosen.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also