EditorSearchView is focus in FindWhat or ReplaceWith?

SyntaxEditor for WPF Forum

Posted 10 years ago by Peter MacNeil
Version: 13.2.0591


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!



[Modified 10 years ago]

Comments (2)

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

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 10 years ago by Peter MacNeil

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

The latest build of this product (v24.1.2) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.