• HOME
  • PRODUCTS
  • DEMOS
  • BUY
  • BLOG
  • FORUM
  • DOCUMENTATION
  • ABOUT
  • FREE EVALUATION
Search Results for

    Show / Hide Table of Contents

    SearchLen Property

    SearchLen

    Represents length of the last found text.

    Declaration
    [Browsable(false)]
    public virtual int SearchLen { get; }
    Property Value
    Type Description
    Int32
    Implements
    ISearch.SearchLen
    Remarks

    You can use this property to determine the length of the text fragment found by the last search operation before performing operations on the found text.

    Examples

    Here is how to use a SearchLen in the C# code:

    public partial class Form1 : Form
    {
        private void Form1_Load(object sender, EventArgs e)
        {
            var syntaxEdit1 = new Alternet.Editor.SyntaxEdit(this.components);
            syntaxEdit1.LoadFile("myfile.txt");
            if (syntaxEdit1.Find("my text"))
            {
                System.Windows.Forms.MessageBox.Show(string.Format("Found text length: {0}", syntaxEdit1.SearchLen));
            }
        }
    }
    

    Here is how to use a SearchLen in the Visual Basic code:

    Partial Public Class Form1
        Inherits Form
    
        Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
            Dim syntaxEdit1 = New Alternet.Editor.SyntaxEdit(Me.components)
            syntaxEdit1.LoadFile("myfile.txt")
    
            If syntaxEdit1.Find("my text") Then
                System.Windows.Forms.MessageBox.Show(String.Format("Found text length: {0}", syntaxEdit1.SearchLen))
            End If
        End Sub
    End Class
    
    In This Article
    Back to top Copyright AlterNET Software Download PDF