GdPicture.NET.14
GdPicture14 Namespace / GdViewer Class / HideTextEditBox Method
Set this parameter to true to save the currently defined text to the related annotation object, otherwise set it to false.
Example





In This Topic
HideTextEditBox Method (GdViewer)
In This Topic
Terminates the editing mode for modifying the annotation text within its rectangle area. You can specify if the defined text will be saved to the related annotation.

The annotation rectangle area previously enabled for editing by DisplayTextEditBox method will be disabled. If the editable dialogue box is not displayed, this method will fail.

The AnnotationEndEditingText event is raised after closing the dialogue box.

Syntax
'Declaration
 
Public Function HideTextEditBox( _
   ByVal SaveText As Boolean _
) As GdPictureStatus
public GdPictureStatus HideTextEditBox( 
   bool SaveText
)
public function HideTextEditBox( 
    SaveText: Boolean
): GdPictureStatus; 
public function HideTextEditBox( 
   SaveText : boolean
) : GdPictureStatus;
public: GdPictureStatus HideTextEditBox( 
   bool SaveText
) 
public:
GdPictureStatus HideTextEditBox( 
   bool SaveText
) 

Parameters

SaveText
Set this parameter to true to save the currently defined text to the related annotation object, otherwise set it to false.

Return Value

A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK. We strongly recommend always checking this status first.
Remarks
Be aware that if the annotation rectangle area is not displayed as the editable dialogue box, this method will fail.

The method only handles GdPicture/XMP annotations as well.

Just to remind you that the AnnotationEndEditingText event is raised using this method.

Example
How to prevent users from editing the annotation text.
'We assume that the GdViewer1 control has been properly integrated
'and the AnnotationStartEditingText event has been properly added.
            
'Define the event.
Sub GdViewer1_AnnotationStartEditingText(ByVal AnnotationIdx As Integer) Handles GdViewer1.AnnotationStartEditingText
    Dim annot As GdPicture14.Annotations.Annotation = GdViewer1.GetAnnotationFromIdx(AnnotationIdx)
    Dim text As String = ""
    If TypeOf annot Is GdPicture14.Annotations.AnnotationStickyNote Then
        text = (CType(annot, GdPicture14.Annotations.AnnotationStickyNote)).Text
    ElseIf TypeOf annot Is GdPicture14.Annotations.AnnotationText Then
        text = (CType(annot, GdPicture14.Annotations.AnnotationText)).Text
    End If
    'Hiding the editable dialogue box without allowing users to change the original text.
    HideTextEditBox(false)
    MessageBox.Show(text, "GdViewer.HideTextEditBox")
End Sub
//We assume that the GdViewer1 control has been properly integrated
//and the AnnotationStartEditingText event has been properly added.
            
//Define the event.
void GdViewer1_AnnotationStartEditingText(int AnnotationIdx)
{
    GdPicture14.Annotations.Annotation annot = GdViewer1.GetAnnotationFromIdx(AnnotationIdx);
    string text = "";
    if (annot is GdPicture14.Annotations.AnnotationStickyNote)
        text = ((GdPicture14.Annotations.AnnotationStickyNote)annot).Text;
    else if (annot is GdPicture14.Annotations.AnnotationText)
        text = ((GdPicture14.Annotations.AnnotationText)annot).Text;
    //Hiding the editable dialogue box without allowing users to change the original text.
    HideTextEditBox(false);
}
See Also