Back to Devexpress

AnnotationTextEditingEventArgs Class

corelibraries-devexpress-dot-xtracharts-b42f5ceb.md

latest3.1 KB
Original Source

AnnotationTextEditingEventArgs Class

Data for the ChartControl.AnnotationRepositoryChanging event that occurs when the text annotation is edited.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
public sealed class AnnotationTextEditingEventArgs :
    AnnotationRepositoryChangingEventArgs
vb
Public NotInheritable Class AnnotationTextEditingEventArgs
    Inherits AnnotationRepositoryChangingEventArgs

Remarks

You can use AnnotationTextEditingEventArgs if the AnnotationRepositoryChanging event occurs after a user edits the text annotation. Cast the AnnotationRepositoryChangingEventArgs to the AnnotationTextEditingEventArgs type in the AnnotationRepositoryChanging event handler. AnnotationTextEditingEventArgs exposes the NewText property, which contains the new annotation’s text.

The following example gets the new annotation’s text:

csharp
void chartControl1_AnnotationRepositoryChanging(object sender, AnnotationRepositoryChangingEventArgs e) {
  if (e.Change == AnnotationRepositoryChange.Text) {
      AnnotationTextEditingEventArgs textEditingArgs = (AnnotationTextEditingEventArgs)e;
      string newAnnotationText = textEditingArgs.NewText;
      //Add your logic here. 
  }    
}
vb
Private Sub chartControl1_AnnotationRepositoryChanging(ByVal sender As Object, ByVal e As AnnotationRepositoryChangingEventArgs)
    If e.Change = AnnotationRepositoryChange.Text Then
        Dim textEditingArgs As AnnotationTextEditingEventArgs = CType(e, AnnotationTextEditingEventArgs)
        Dim newAnnotationText As String = textEditingArgs.NewText
        'Add your logic here.
    End If
End Sub

Inheritance

Object EventArgs AnnotationRepositoryChangingEventArgs AnnotationTextEditingEventArgs

See Also

AnnotationTextEditingEventArgs Members

Annotations

DevExpress.XtraCharts Namespace