(Leadtools.Annotations.Automation)

EditText Event

Show in webframe
Example 




Occurs when the text of an AnnObject is edited.
Syntax
public event EventHandler<AnnEditTextEventArgs> EditText
public event EventHandler<AnnEditTextEventArgs> EditText
-(void) automation:(LTAnnAutomation*) automation 
  editTextWithArgs:(LTAnnEditTextEventArgs*) e;
            
public void addEditTextListener(AnnEditTextListener listener)
public void removeEditTextListener(AnnEditTextListener listener)
            
add_EditText(function(sender, e))
remove_EditText(function(sender, e))

Event Data

The event handler receives an argument of type AnnEditTextEventArgs containing data related to this event. The following AnnEditTextEventArgs properties provide information specific to this event.

PropertyDescription
Bounds  
Cancel  
TextObject  
Remarks

This event will occur when the object being edited is a text object and the user initiates edit mode. For more information, refer to AnnTextEditDesigner.EditText.

Example
Copy Code  
using Leadtools.Annotations.Automation;
using Leadtools.Annotations.Core;
using Leadtools.Codecs;
using Leadtools.WinForms;

public void AnnAutomation_EditText()
{
   // Hook to the automation's EditText event
   _automation.EditText += _automation_EditText;
}
void _automation_EditText(object sender, AnnEditTextEventArgs e)
{
   // In your application, you could show a dialog to enter the new text value or create
   // a text element on the page for editing
   // e is of type AnnEditTextEventArgs

   // Get the text annotation object
   AnnTextObject textObj = e.TextObject;
   // Change its text
   textObj.Text = "After edit";
   // Invalidate it
   _automation.Invalidate(LeadRectD.Empty);
}
using Leadtools.Annotations.Automation;
using Leadtools.Controls;
using Leadtools.Converters;
using Leadtools.Annotations.Core;
using Leadtools.Codecs;

[TestMethod]
public void AnnAutomation_EditText()
{
   // Hook to the automation's EditText event
   _automation.EditText += _automation_EditText;
}
void _automation_EditText(object sender, AnnEditTextEventArgs e)
{
   // In your application, you could show a dialog to enter the new text value or create
   // a text element on the page for editing
   // e is of type AnnEditTextEventArgs

   // Get the text annotation object
   AnnTextObject textObj = e.TextObject;
   // Change its text
   textObj.Text = "After edit";
   // Invalidate it
   _automation.Invalidate(LeadRectDHelper.Empty);
}
Requirements

Target Platforms

See Also

Reference

AnnAutomation Class
AnnAutomation Members

 

 


Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.