简体   繁体   中英

WebBrowser control invalid z-index rendering for <select> tag

I have a WebBrowser control that loads web-page, targeted IE 9+. The problem is that this page is displayed normally in IE 9, 10, latest Firefox and Chrome, but when displaying in WebBrowser control, something goes wrong and drop-down appears over the calendar:

在此处输入图片说明

z-index of calendar is 1, for tag it is not set (I also tried setting 0 explicitly - same result).

Page contains meta tag:

<meta content="IE=8,9" http-equiv="X-UA-Compatible"></meta>

so I excluded possibility of wrong compatibility mode of IE. In addition "Save" and "Close" buttons looks OK, so it is at least IE 9 mode (they look worse in IE 8 and 7).

Does anybody have an idea why the layout can be different in normal IE browser and WebBrowser control?

UPDATE: Issue only reproducing when the windows form with WebBrowser control is shown as a plugin of MS Word (2010). The same form, when run as a standalone application, is displayed as expected.

The issue appeared to be in the feature called 'FEATURE_USE_WINDOWEDSELECTCONTROL' (registry node 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Internet Explorer\\MAIN\\FeatureControl\\FEATURE_USE_WINDOWEDSELECTCONTROL'). It was enabled for WinWord.exe by default. Removing registry value 'WinWord.exe' fixed the problem.

I suppose it is a direct answer to the original question. But I'm not sure it is safe to remove this node from registry and how it can affect other applications and MS Word functionality.

It is said that non-windowed select control came to substitute the older (IE6-style) windowed control, but it had compatibility issues in IE7 with MS Office 2003 applications, so the registry setting 'FEATURE_USE_WINDOWEDSELECTCONTROL' was introduced to enable reverting this change. I didn't find any confirmation that that issues are not present in newer versions of MS Word, but from what I've found about possible issues and tested that - they are not reproduced (crashes when using select control with keyboard).

It is likely that I'll accept this solution and remove the setting FEATURE_USE_WINDOWEDSELECTCONTROL for MS Word 2010. If anybody knows the reason not to do this, please let me know.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM