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



id
The ID of the AnnAutomationObject to find
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
)
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
Private Sub AnnAutomationManager_FindObject(ByVal manager As AnnAutomationManager)
  ' fine the line automation object
  Dim autObj As AnnAutomationObject = manager.FindObject(AnnAutomationManager.LineObjectId)
  If Not autObj Is Nothing Then
    autObj.Object.Stroke = Brushes.Blue
    autObj.Object.StrokeThickness = 2.0
  End If
End Sub
C#Copy Code
private void AnnAutomationManager_FindObject(AnnAutomationManager manager) 

   // fine the line automation object 
   AnnAutomationObject autObj = manager.FindObject(AnnAutomationManager.LineObjectId); 
   if(autObj != null) 
   { 
      autObj.Object.Stroke = Brushes.Blue; 
      autObj.Object.StrokeThickness = 2.0; 
   } 
}

Remarks

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

Requirements

Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Vista, and Windows Server 2003 family

See Also

FindObject requires a Document/Medical product license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features and Unlocking Special LEAD Features.