I have a FindReplaceForm that I keep around and use Show() when the user presses a key. The first time this occurs, the form is created with some default options.
I am trying to change the options on the existing instance of the form to no avail.
There are two things I want to change before calling Show():
1) If there is any selected text, set SearchInSelection = true
2) If there is a word under the cursor, set FindText to that wordI've tried using:
findReplacementForm.Option.X = value
I've tried retaining a reference to the original FindReplaceOptions instance I created when I created the FindReplaceForm and setting those.
It seems to ignore any changes made after the FindReplaceForm has been created.
I am trying to change the options on the existing instance of the form to no avail.
There are two things I want to change before calling Show():
1) If there is any selected text, set SearchInSelection = true
2) If there is a word under the cursor, set FindText to that word
findReplaceOptions.SearchInSelection = codeEditor.SelectedView.Selection.Length > 0;
string caretWord = codeEditor.Document.GetWordText(codeEditor.Caret.Offset);
if (!String.IsNullOrEmpty(caretWord))
findReplaceOptions.FindText = caretWord;
findReplacementForm.Option.X = value
I've tried retaining a reference to the original FindReplaceOptions instance I created when I created the FindReplaceForm and setting those.
It seems to ignore any changes made after the FindReplaceForm has been created.