Example





In This Topic
GdPicture14 Namespace / GdViewer Class / RectIsEditable Property

RectIsEditable Property (GdViewer)

In This Topic
Determines, if the rectangle of area selection can be moved or resized (edited) by a user. You are allowed to edit the rectangle using the mouse when the MouseMode property is set to GdPicture14.ViewerMouseMode.MouseModeAreaSelection.

You can find out, if this rectangle is currently defined and drawn within the GdViewer control, using the IsRect method. The rectangle of selection always relates to the document currently displayed in the GdViewer control.

Syntax
'Declaration
 
Public Property RectIsEditable As Boolean
public bool RectIsEditable {get; set;}
public read-write property RectIsEditable: Boolean; 
public function get,set RectIsEditable : boolean
public: __property bool get_RectIsEditable();
public: __property void set_RectIsEditable( 
   bool value
);
public:
property bool RectIsEditable {
   bool get();
   void set (    bool value);
}

Property Value

The default value is true.
Remarks
Be aware that you are allowed to define only one rectangle of selection within the GdViewer control. The property value does not change when reloading documents in the control.
Example
How to disable editing of the displayed rectangle of area selection.
'We assume that the GdViewer1 control has been properly integrated.
If GdViewer1.DisplayFromFile("") = GdPictureStatus.OK Then
    Dim text_to_find As String = "GdPicture"
    GdViewer1.ClearRect()
    GdViewer1.RectIsEditable = False
    Dim text_found As Boolean = GdViewer1.SearchText(text_to_find, 1, True)
    If GdViewer1.GetStat() = GdPictureStatus.OK Then
        If text_found AndAlso GdViewer1.IsRect() Then
            GdViewer1.CenterOnRect()
        Else
            MessageBox.Show("The given text has not been found.", "GdViewer.RectIsEditable")
        End If
    Else
        MessageBox.Show("The search process has failed. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.RectIsEditable")
    End If
Else
    MessageBox.Show("The file can't be displayed. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.RectIsEditable")
End If
//We assume that the GdViewer1 control has been properly integrated.
if (GdViewer1.DisplayFromFile("") == GdPictureStatus.OK)
{
    string text_to_find = "GdPicture";
    GdViewer1.ClearRect();
    GdViewer1.RectIsEditable = false;
    bool text_found = GdViewer1.SearchText(text_to_find, 1, true);
    if (GdViewer1.GetStat() == GdPictureStatus.OK)
    {
        if (text_found && GdViewer1.IsRect())
            GdViewer1.CenterOnRect();
        else
            MessageBox.Show("The given text has not been found.", "GdViewer.RectIsEditable");
    }
    else
        MessageBox.Show("The search process has failed. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.RectIsEditable");
}
else
    MessageBox.Show("The file can't be displayed. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.RectIsEditable");
See Also