4

I want to launch a custom Find and Replace modeless WPF dialog from Excel. I'm able to launch a WPF window as a modeless dialog, and used WindowInteropHelper to assign Excel as parent for the dialog. The issue what i'm facing is, if I enter text in dialog textbox, it is getting entered in the active cell in Excel. I found solution for this issue in the link "WPF modeless dialog from MS Excel add-in"

Link is suggesting to create separate thread for the dialog. If I do so, then Excel is not displaying the selection in the worksheet when focus is in dialog. I want to mimic the Excel Find and Replace dialog behavior, that is, though the focus is in Excel Find and Replace dialog, the selection in the worksheet should be displayed. If I'm not using separate thread for the WPF dialog creation(creating dialog in the main thread) I could able to achieve the selection behavior as expected, but keyboard inputs are not reflecting in the dialog.

Please help me in resolving the keyboard input issue with the modeless WPF dialog without the usage of a separate thread for dialog creation.

Using C# .Net 4.0

Thanks in advance.

Community
  • 1
  • 1
Sree
  • 41
  • 2

0 Answers0