开发者

Need to tab out of ActiveX control in browser

开发者 https://www.devze.com 2023-01-06 20:52 出处:网络
When tabbing thro开发者_Go百科ugh controls in an ActiveX control hosted in IE, once I get to the last control the tab key no longer does anything. I would like it to move the focus outside the ActiveX

When tabbing thro开发者_Go百科ugh controls in an ActiveX control hosted in IE, once I get to the last control the tab key no longer does anything. I would like it to move the focus outside the ActiveX control to the next html control.

This works fine when the ActiveX control is hosted in a WinForms app, does anybody know how to make this work in the browser?

It may also be relevant that the ActiveX control is a simple wrapper around a WPF control.


I found a hacky solution.

The problem is tabbing out of the WPF control, so I've placed a hidden textbox after the ElementHost within the ActiveX control. Tabbing out of the WPF control moves focus to the hidden control correctly, which upon receiving focus uses SendKeys("{TAB}".

Just typing SendKeys makes me feel a little dirty though, so if anyone has a better solution...

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号