←Select platform

FindObject Method

Summary

Finds the AnnAutomationObject associated with a certain ID.

Syntax

C#
VB
C++
public AnnAutomationObject FindObject( 
   int id 
) 
  
Public Function FindObject( _ 
   ByVal id As Integer _ 
) As Leadtools.Windows.Annotations.AnnAutomationObject 

Parameters

id
The ID of the AnnAutomationObject to find

Return Value

The AnnAutomationObject from Objects for this ID if found; null (Nothing in VB) otherwise.

Remarks

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

Example

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

C#
VB
Silverlight C#
Silverlight VB
using Leadtools.Windows.Controls; 
using Leadtools.Windows.Annotations; 
using Leadtools.Demos; 
using Leadtools.Help; 
 
private void AnnAutomationManager_FindObject(AnnAutomationManager manager) 
{ 
   // fine the line automation object 
   AnnAutomationObject autObj = manager.FindObject(AnnAutomationManager.LineObjectId); 
   if (autObj != null) 
   { 
      autObj.Object.Stroke = Colors.Blue; 
      autObj.Object.StrokeThickness = 2.0; 
   } 
} 
Imports Leadtools.Windows.Controls 
Imports Leadtools.Windows.Annotations 
 
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 = Colors.Blue 
      autObj.Object.StrokeThickness = 2.0 
   End If 
End Sub 
using Leadtools.Windows.Controls; 
using Leadtools.Windows.Annotations; 
using Leadtools.Examples; 
using Leadtools.Silverlight.Demos; 
//using Leadtools.Help; 
 
private void AnnAutomationManager_FindObject(AnnAutomationManager manager) 
{ 
   // fine the line automation object 
   AnnAutomationObject autObj = manager.FindObject(AnnAutomationManager.LineObjectId); 
   if (autObj != null) 
   { 
      autObj.Object.Stroke = Colors.Blue; 
      autObj.Object.StrokeThickness = 2.0; 
   } 
} 
Imports Leadtools.Windows.Controls 
Imports Leadtools.Windows.Annotations 
Imports Leadtools.Silverlight.Demos 
'using Leadtools.Help; 
 
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 = Colors.Blue 
      autObj.Object.StrokeThickness = 2.0 
   End If 
End Sub 

Requirements

Target Platforms

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Windows.Annotations Assembly