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

    Show / Hide Table of Contents

    SearchPos Property

    SearchPos

    Gets or sets a value that represents position of the last found text.

    Declaration
    [Browsable(false)]
    public virtual Point SearchPos { get; set; }
    Property Value
    Type Description
    Point
    Implements
    ISearch.SearchPos
    Remarks

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

    Examples

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

    public partial class MainWindow : Window
    {
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            var textEditor = new Alternet.Editor.Wpf.TextEditor();
            textEditor.LoadFile("myfile.txt");
            if (textEditor.Find("my text"))
            {
                System.Windows.MessageBox.Show(string.Format("Found text search pos: {0}", textEditor.SearchPos));
            }
        }
    }
    

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

    Partial Public Class MainWindow
    
        Private Sub Window_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
            Dim textEditor = New Alternet.Editor.Wpf.TextEditor()
            textEditor.LoadFile("myfile.txt")
    
            If textEditor.Find("my text") Then
                System.Windows.MessageBox.Show(String.Format("Found text search pos: {0}", textEditor.SearchPos))
            End If
        End Sub
    End Class
    
    In This Article
    Back to top Copyright AlterNET Software Download PDF