
Hey,
How do you programmatically show the new Search Overly Pane when a View is first created?
Best regards,
Bill
Hey,
How do you programmatically show the new Search Overly Pane when a View is first created?
Best regards,
Bill
Hi Bill,
Our code for the Ctrl+F "find" edit action is basically:
// Update the find text
this.UpdateSearchOptionsFindTextFromSelection(view);
// If the editor is in multi-line mode...
if (view.SyntaxEditor.IsMultiLine) {
// Ensure the search pane is open and active
var searchPane = view.OverlayPanes[OverlayPaneKeys.Search] as SearchOverlayPane;
if (searchPane != null) {
searchPane.IsReplaceVisible = false;
searchPane.SearchOptions = view.SyntaxEditor.SearchOptions;
}
else
searchPane = view.OverlayPanes.AddSearch(false) as SearchOverlayPane;
// Activate the pane
if (searchPane != null)
searchPane.Activate();
}
You should be able to use similar code for your needs. But note that the Activate method call is to focus the "find what" TextBox. You could leave that out if you are just wanting to show it but not focus it.
We will add this code listing to the documentation as well.
You also could execute our built-in edit action commands like EditorCommands.Find to do the same thing.
Please log in to a validated account to post comments.