LEADTOOLS Annotations (Leadtools.Annotations assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.29
AutoSizeAfterEdit Property
See Also 
Leadtools.Annotations Namespace > AnnTextEditDesigner Class : AutoSizeAfterEdit Property



The AutoSizeAfterEdit Property is available in LEADTOOLS Document and Medical Imaging toolkits.

Gets or sets a value indicating whether the designer will automatically resize the AnnTextObject beging edited after the user finish editing it.

Syntax

Visual Basic (Declaration) 
Public Property AutoSizeAfterEdit As Boolean
Visual Basic (Usage)Copy Code
Dim instance As AnnTextEditDesigner
Dim value As Boolean
 
instance.AutoSizeAfterEdit = value
 
value = instance.AutoSizeAfterEdit
C# 
public bool AutoSizeAfterEdit {get; set;}
C++/CLI 
public:
property bool AutoSizeAfterEdit {
   bool get();
   void set (    bool value);
}

Property Value

true for the designer to automatically resize the AnnTextObject beging edited after the user finish editing it, false; otherwise. Default value is false.

Example

Visual BasicCopy Code
Public Sub AnnTextEditDesigner_AutoSizeAfterEditExample(ByVal automation As AnnAutomation)
   ' We will hook to the Automation designer changed event,
   ' if the designer is a Text edit designer, we will set
   ' its AutoSizeAfterEdit value to true
   AddHandler automation.CurrentDesignerChanged, AddressOf automation_CurrentDesignerChanged
End Sub

Private Sub automation_CurrentDesignerChanged(ByVal sender As Object, ByVal e As EventArgs)
   ' Check if current designer is AnnTextEditDesigner
   Dim automation As AnnAutomation = CType(sender, AnnAutomation)
   If Not automation.CurrentDesigner Is Nothing Then
      If TypeOf automation.CurrentDesigner Is AnnTextEditDesigner Then
         ' Yes, set its AutoSizeAfterEdit value to true
         Dim textEditDesigner As AnnTextEditDesigner = CType(automation.CurrentDesigner, AnnTextEditDesigner)
         textEditDesigner.AutoSizeAfterEdit = True
      End If
   End If
End Sub
C#Copy Code
public void AnnTextEditDesigner_AutoSizeAfterEditExample(AnnAutomation automation)
{
   // We will hook to the Automation designer changed event,
   // if the designer is a Text edit designer, we will set
   // its AutoSizeAfterEdit value to true
   automation.CurrentDesignerChanged += new EventHandler(automation_CurrentDesignerChanged);
}

private void automation_CurrentDesignerChanged(object sender, EventArgs e)
{
   // Check if current designer is AnnTextEditDesigner
   AnnAutomation automation = sender as AnnAutomation;
   if(automation.CurrentDesigner != null)
   {
      AnnTextEditDesigner textEditDesigner = automation.CurrentDesigner as AnnTextEditDesigner;
      if(textEditDesigner != null)
      {
         // Yes, set its AutoSizeAfterEdit value to true
         textEditDesigner.AutoSizeAfterEdit = true;
      }
   }
}

Remarks

When the value of this property is set to true, the designer will call the AnnTextObject.AutoSize method when it has finished editing the object.

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7

See Also

Leadtools.Annotations requires a Document or Medical toolkit license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features