-1

i´m writing a small C# Wpf application and I integrated the ExplorerBrowser of the WindowsApiCodepack. This is working really nice. The only problem I have and where I haven´t found a solution so far is: How can I programatically set the focus (keyboard focus) to the ExplorerBrowser control, so that I can select a folder without clicking on it with the mouse before?

Does someone have exerience with the control?

Additional Note: What I found out so far is, that focus problems are a common problem for winform controls, which are inserted into a wpf window via the WindowsFormsHost class. But i haven´t found a good workaround so far.

SteveTc
  • 1
  • 1

1 Answers1

0

I don't have a clue about the WindowsApiCodepack, but I think u just have to call the ".Focus()" function of the control.

coolerfarmer
  • 385
  • 2
  • 9
  • That was the first I looked for, but it doesn´t give me keyboard focus or even control focus. I´m not sure if it has something to do with the fact that the explorer wpf control is a wrapper for the WinForms explorer control. But i tried to give focus to the wpf control as well as on the inner winforms control. – SteveTc Jul 04 '14 at 08:35