private string getContent() { var position = textBoxSearch.SelectionStart; return textBoxSearch.Text.Substring(0, position); }