Delete key is not being captured exclusively by WebBrowser

Add-in Express™ Support Service
That's what is more important than anything else

Delete key is not being captured exclusively by WebBrowser
 
Itamar Amith




Posts: 1
Joined: 2020-03-05
Hi there!

Our app uses a System.Windows.Controls.WebBrowser (Not a System.Windows.Forms.WebBrowser) inside a task pane that renders a remote login page. Once the user is authenticated, the WebBrowser is replaced with standard WPF controls.

If the user shifts the focus from the WebBrowser (by say clicking on an Email in the explorer), and then clicks back into the WebBrowser, hitting the delete key sends the key to both the WebBrowser (where it will delete a character in front of the caret), as well as to the Outlook explorer, where it might delete a highlighted Email.

This peculiar issue that appears to resurface every now and then (eg here: https://www.add-in-express.com/forum/read.php?FID=5&TID=14028), but it usually being handled in private messages, so we're not sure about what is the best way to resolve it at the moment.

The current hierarchy of components in our addin is:

System.ComponentModel.Container
  AddinExpress.MSO.ADXTaskPane
    System.Windows.Forms.UserControl (derived)
      System.Windows.Forms.Integration.ElementHost
        System.Windows.Forms.UserControl (derived)
          System.Windows.Controls.DockPanel
            System.Windows.Controls.Grid
              System.Windows.Forms.UserControl (derived)
                System.Windows.Controls.WebBrowser


In the post linked above, you mentioned introducing a form group might be able to resolve this issue. Would this be the case here?

Cheers,
Itamar
Posted 05 Mar, 2020 22:07:50 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Hello Itamar,

We can't reproduce this issue using a new add-in project with no code. Do you have any event handler processing keyboard presses? If not, provide a sample project reproducing the issue and send it to the support email address; find it in {Add-in Express installation folder}\readme.txt; please make sure your email contains a link to this topic.


Andrei Smolin
Add-in Express Team Leader
Posted 06 Mar, 2020 03:45:12 Top
James Telfer




Posts: 9
Joined: 2020-03-13
Thanks Andrei; I've emailed a minimal reproduction in a new project.
Posted 25 Mar, 2020 06:34:40 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Hello James,

Thank you for the test project. It shows that you use a custom task pane (CTP). That Microsoft technology doesn't do anything to let you control how keyboard shortcuts are handled. For instance, pressing Ctrl+N opens a new compose email Outlook inspector window. This is sort of expected, since you work in Outlook; this isn't expected though since you do this on a task pane. Also, you can't use Backspace and Delete keys.

I suggest that you try to use an Add-in Express pane instead; check section Step #10 ?Â?Ð?ã Creating an Advanced Outlook Region in Outlook 2000-2019; see the PDF file in the folder {Add-in Express}\Docs on your development PC.

It has problems of its own: panes in Office is a whole bunch of compromises. Still, it works far better. For me, the keyboard shortcuts mentioned work correctly. Pressing Ctrl+N opens a new IE window with the page specified in webBrowser1.Url.

I've noticed however that there's a cross control which is shown in the first input box after you enter some letters and press Enter; you click that control to clear the input box. When testing this on an ADXOlForm, the control doesn't work; it works when in the CTP. I've tried to open that page in different browsers and I have an impression that there's some problem with that control: it doesn't show in some browsers.

I've tried using this page: https://primefaces.org/primeng/showcase/#/chips; if you enter something in the first input box and press Enter, you'll see a similar cross control. This one works in my case.


Andrei Smolin
Add-in Express Team Leader
Posted 25 Mar, 2020 10:40:25 Top