Error processing SSI file
(Leadtools.Annotations.Automation)

Show in webframe

EditText Event






Occurs when the text of an AnnObject is edited.
Syntax
public event EventHandler<AnnEditTextEventArgs> EditText
'Declaration
 
Public Event EditText As EventHandler(Of AnnEditTextEventArgs)
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 Gets the bounding rectangle of the AnnTextObject entering text-editing mode in screen/device coordinates.
Cancel Gets or sets a value indicating whether edit mode should be canceled.
TextObject Gets the AnnTextObject that is entering text-editing mode.
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.

If the value of EditTextAfterDraw is set to true, then this event will occur automatically after the designer finishes drawing new text objects.

Example

This example will show how to change the string used by an annotation text object when it enters edit mode.

Start with the AnnAutomationManager example, remove all the code inside the example function (search for the // TODO: add example code here comment) and insert the following code:

Click the example button then draw a text object and double click on it.

Copy Code  
using Leadtools.Annotations.Automation;
using Leadtools.Annotations.Core;
using Leadtools.Codecs;
using Leadtools.Controls;
using Leadtools.Annotations.Rendering;
using Leadtools.Annotations.WinForms;

[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(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

Error processing SSI file
  Leadtools.Annotations.Automation requires a Document or Medical toolkit license and unlock key. For more information, refer to: LEADTOOLS Toolkit Features