Leadtools.Annotations Requires Document/Medical product license | Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.10.31
FindObject Method
See Also  Example
Leadtools.Annotations Namespace > AnnAutomationManager Class : FindObject Method




id
The id of the AnnAutomationObject to find
Finds the AnnAutomationObject associated with a certain id.

Syntax

Visual Basic (Declaration) 
Public Function FindObject( _
   ByVal id As Integer _
) As AnnAutomationObject
Visual Basic (Usage)Copy Code
Dim instance As AnnAutomationManager
Dim id As Integer
Dim value As AnnAutomationObject
 
value = instance.FindObject(id)
C# 
public AnnAutomationObject FindObject( 
   int id
)
Managed Extensions for C++ 
public: AnnAutomationObject* FindObject( 
   int id
) 
C++/CLI 
public:
AnnAutomationObject^ FindObject( 
   int id
) 

Parameters

id
The id of the AnnAutomationObject to find

Return Value

The AnnAutomationObject from Objects for this id if found; null (Nothing in Visual Basic) otherwise.

Example

This example changes the line color of new line automation objects to blue.

Visual BasicCopy Code
Public Sub AnnAutomationManager_FindObject(ByVal manager As AnnAutomationManager)
   ' fine the line automation object
   Dim obj As AnnAutomationObject = manager.FindObject(AnnAutomationManager.LineObjectId)
   If Not obj Is Nothing Then
      obj.Object.Pen = New AnnPen(Color.Blue, New AnnLength(1, AnnUnit.Pixel))
   End If
End Sub
C#Copy Code
public void AnnAutomationManager_FindObject(AnnAutomationManager manager) 

  // fine the line automation object 
  AnnAutomationObject obj = manager.FindObject(AnnAutomationManager.LineObjectId); 
  if(obj != null) 
     obj.Object.Pen = new AnnPen(Color.Blue, new AnnLength(1, AnnUnit.Pixel)); 
}

Remarks

This method enumerates all of the AnnAutomationObject items in the Objects collection and compares Id with id.

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Leadtools.Annotations requires a Document or Medical toolkit license and unlock key. For more information, refer to: Raster Pro/Document/Medical Features