|
Rank: Newbie Groups: Member
Joined: 4/27/2022 Posts: 5
|
I use EO browser inside WPF dialog in Excel addin. Currently, the browser is running on the main thread. It's almost all good except when the users switch between the browser and Excel, the focus may not switch correctly when they are clicking on a cell in a worksheet. I think, this may be happening because the dialog needs to be running on a separate thread. Is it possible to do? Thanks.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
No. The browser should run in the main UI thread. However we are not sure whether your plugin main thread is indeed Excel's main UI thread. That might be something you want to check.
Regardless, it's unlikely the focus issue has anything to do with thread. Most likely it occurs because Excel and WPF has some kind of focus caching/restoring mechanism in play. Can you describe in detail on how the focus may not switch correctly?
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 4/27/2022 Posts: 5
|
Hi,
I did test it. It doesn't have anything to do with EO Browser. It just Excel and WPF dialogs. If I open a new dialog (empty) on a main thread, I will get this issue - Excel cells are selectable while the focus is still on the dialog. If I create a new task with this dialog and start it on another thread, then every time I click on the cells the focus fully moves over to Excel.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
In that case you might want to try Windows.Forms instead. WPF does have its own focus managing mechanism because multiple focusable WPF controls share a single window handle. On Windows.Forms on the other hand every control has its own window handle, so focus is managed by Windows instead. This might work better in your case.
Thanks!
|
|