CogInteractiveGraphicsContainer FindItem Method Cognex VisionPro 9.7
Finds the first matching item and returns its index.

Namespace: Cognex.VisionPro.Display
Assembly: Cognex.VisionPro.Display.Controls (in Cognex.VisionPro.Display.Controls.dll) Version: 73.0.0.0 (73.0.0.0)
Syntax

public virtual int FindItem(
	Object objectOrGroupName,
	CogDisplayZOrderConstants searchOrigin
)

Parameters

objectOrGroupName
Type: System Object
The item to find or the name of a graphics group.
searchOrigin
Type: Cognex.VisionPro.Display CogDisplayZOrderConstants
When searchOrigin is Front, the search starts at the front of the z-order. When searchOrigin is Back, the search starts at the end of the z-order.

Return Value

Type: Int32
The index of the matching item, or -1 if no item was found.
Exceptions

ExceptionCondition
ObjectDisposedException Thrown when the object is already disposed.
CogException Thrown when any of the arguments are invalid.
Remarks

If objectOrGroupName is a group name, FindItem(Object, DisplayZOrderConstants) returns the first item in the group when searchOrigin is Front and the last item in the group when searchOrigin is Back.

Examples

See Also