EditorSearchView is focus in FindWhat or ReplaceWith?

SyntaxEditor for WPF Forum

Posted 6 years ago by Peter MacNeil
Version: 13.2.0591
Avatar

Hello,

I need to set the FindWhat and ReplaceWith text strings programmatically. I can do this with the EditorSearchView.SearchOption.FindText and ReplaceText.

The problem I am having is determining which has focus, the FindText or the ReplaceText controls.

When the EditorSearchView.Mode is Replace, how do I determine which edit control if either has focus?

 

A little extra background info:

I'm hosting the WPF SyntaxEditor in HwndSource inside of a C++ application. The C++ handlers for the edit menu functions, cut, copy, paste, are acting by accessing the SyntaxEditor and the EditorSearchView by way of attached properties. My current difficulty is in implementing the attached property to handle the paste function into the appropriate edit control inside the EditSearchView.

Thanks for your help!

 

Pete

[Modified 6 years ago]

Comments (2)

Answer - Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Peter,

Perhaps you could look at Keyboard.FocusedElement.  Then if it's a TextBox, check the name.  The find TextBox is PART_FindWhatTextBox, and the replace TextBox is PART_ReplaceWithTextBox.


Actipro Software Support

Posted 6 years ago by Peter MacNeil
Avatar

That was just what I needed. Thank you very much!

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.