Fuzzymonk

The webbrowser control insists on drawing all the widgets/form elements/buttons in with an legacy-style hard beveled look.

When I use an input tag with type="button" in the webbrowser control it looks like a system button on windows 95. However when I view that same page in IE6 or 7 it has a nice soft rounded look. Is there a way to get webbrowser control to look the same as IE

Thanks.

-C


Re: Internet Explorer Extension Development WebBrowser Control: Old-timey Button Style

Fuzzymonk

Figured it out:


Add this to the head of the html
<meta http-equiv="MSThemeCompatible" content="yes" />
Or, modify the http headers with:

MSThemeCompatible: Yes






Re: Internet Explorer Extension Development WebBrowser Control: Old-timey Button Style

John Sudds - MSFT

Great find... Thanks for sharing it.

Let me add some details from the logic behind this feature.

First, an app must be themed. A visual style can be turned off in Control Panel, so that an application can support visual styles but not have a visual style applied at a given time.

Second, you can turn on themes with DOCHOSTUIFLAG_THEME. Return this flag when requested in GetHostInfo. To do this, you will need to implement IDocHostUIHandler and call the ICustomDoc:: SetUIHandler of the document. Themes ON can be overridden by a META tag, but themes OFF cannot--go figure.

Third, if the host doesn't declare a theme-related DOCHOSTUIFLAG, the registry is consulted.

HKCU|HKLM\Software\Policies\Microsoft\Internet Explorer\UseThemes (BOOL)*

Finally, the meta tag is used.