GdPicture.NET.14
GdPicture14 Namespace / GdViewer Class / RegionsAreEditable Property
Example





In This Topic
RegionsAreEditable Property (GdViewer)
In This Topic
Determines if highlighted regions can be edited, that means selected, moved or resized by a user.

Highlighted regions for currently displayed document are identified and created when searching text, for example using the SearchText(String,Int32,Boolean) method or the second similar overloaded method as well. You can also define highlighted regions directly using AddRegion(String,Int32,Int32,Int32,Int32,ForegroundMixMode,Int32) or AddRegionInches(String,Single,Single,Single,Single,ForegroundMixMode,Int32) methods.

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

Property Value

The default value is true.
Remarks
Be aware that turning this property to false disables both region editing and the region selection as well.
Example
How to disable editing highlighted regions.
'We assume that the GdViewer1 control has been properly integrated.
If GdViewer1.DisplayFromFile("") = GdPictureStatus.OK Then
    Dim text_to_find As String = "GdPicture"
    GdViewer1.RemoveAllRegions()
    GdViewer1.RegionsAreEditable = False
    Dim text_found As Boolean = GdViewer1.SearchText(text_to_find, 0, True)
    If GdViewer1.GetStat() = GdPictureStatus.OK Then
        If text_found Then
            GdViewer1.Redraw()
            MessageBox.Show("The number of highlighted regions: " + GdViewer1.RegionCount().ToString(), "GdViewer.RegionsAreEditable")
        Else
            MessageBox.Show("The given text has not been found.", "GdViewer.RegionsAreEditable")
        End If
    Else
        MessageBox.Show("The search process has failed. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.RegionsAreEditable")
    End If
Else
    MessageBox.Show("The file can't be displayed. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.RegionsAreEditable")
End If
//We assume that the GdViewer1 control has been properly integrated.
if (GdViewer1.DisplayFromFile("") == GdPictureStatus.OK)
{
    string text_to_find = "GdPicture";
    GdViewer1.RemoveAllRegions();
    GdViewer1.RegionsAreEditable = false;
    bool text_found = GdViewer1.SearchText(text_to_find, 0, true);
    if (GdViewer1.GetStat() == GdPictureStatus.OK)
    {
        if (text_found)
        {
            GdViewer1.Redraw();
            MessageBox.Show("The number of highlighted regions: " + GdViewer1.RegionCount().ToString(), "GdViewer.RegionsAreEditable");
        }
        else
            MessageBox.Show("The given text has not been found.", "GdViewer.RegionsAreEditable");
    }
    else
        MessageBox.Show("The search process has failed. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.RegionsAreEditable");
}
else
    MessageBox.Show("The file can't be displayed. Status: " + GdViewer1.GetStat().ToString(), "GdViewer.RegionsAreEditable");
See Also