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





Gets the current AnnObjectBase being edited.

Syntax

Visual Basic (Declaration) 
Public ReadOnly Property CurrentEditObject As AnnObjectBase
Visual Basic (Usage)Copy Code
Dim instance As AnnAutomation
Dim value As AnnObjectBase
 
value = instance.CurrentEditObject
C# 
public AnnObjectBase CurrentEditObject {get;}
C++/CLI 
public:
property AnnObjectBase^ CurrentEditObject {
   AnnObjectBase^ get();
}
XAML Syntax 
You cannot use this property in XAML.
XAML Syntax 
You cannot use this property in XAML.

Return Value

The current AnnObjectBase being edited; null (Nothing in Visual Basic) if no objects are currently being edited.

Example

This example changes the stroke of the object that is currently being edited to a Red pen that has a width of 2 pixels.

Visual BasicCopy Code
Private Sub AnnAutomation_ChangeStrokeToBlue(ByVal automation As AnnAutomation)
   ' check if an object is currently "selected"
   If Not automation.CurrentEditObject Is Nothing Then
      ' check if this object supports a pen
      If automation.CurrentEditObject.SupportsStroke Then
         ' change its pen
         automation.BeginUndo()
         automation.CurrentEditObject.Stroke = Brushes.Blue
         automation.CurrentEditObject.StrokeThickness = 2.0
         automation.EndUndo()
      End If
   End If
End Sub
C#Copy Code
private void AnnAutomation_ChangeStrokeToBlue(AnnAutomation automation) 

   // check if an object is currently "selected" 
   if(automation.CurrentEditObject != null) 
   { 
      // check if this object supports a pen 
      if(automation.CurrentEditObject.SupportsStroke) 
      { 
         // change its pen 
         automation.BeginUndo(); 
         automation.CurrentEditObject.Stroke = Brushes.Blue; 
         automation.CurrentEditObject.StrokeThickness = 2.0; 
         automation.EndUndo(); 
      } 
   } 
}

Remarks

(Read only) The current object being edited is the AnnObjectBase currently "selected" where its AnnEditDesigner is currently active.

This is the object that will be processed when calling any of the object processing methods of this AnnAutomation. For example, calling Copy will copy the CurrentEditObject into the clipboard.

You can change the CurrentEditObject by calling StartEditing.

Requirements

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

See Also

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