Esempio n. 1
0
 public void ScrollToNearPosition()
 {
     if (richBox != null)
     {
         richBox.ScrollNearPosition(richBox.SelectionStart);
     }
 }
        void GoTo()
        {
            if (null == LastRichText)
            {
                NewMessage.Show(Loc.Instance.GetString("Please select a note first."));
                return;
            }
            if (PositionsFound != null && Position > -1 && PositionsFound.Count >= Position)
            {
                int PositionToGoTo = PositionsFound [Position];


                // We do not set the Caret yet, because we will fake set
                // it in the following route to a position higher up in the text.
                LastRichText.ScrollNearPosition(PositionToGoTo);

                LastRichText.SelectionStart  = PositionToGoTo;
                LastRichText.SelectionLength = Searchbox.Text.Length;

                //	LastRichText.ScrollToCaret();
                UpdateSearchMatches(Position + 1, PositionsFound.Count);
            }
        }