Solved

Problem loading webpage in web browser control from excel

Posted on 2011-02-22
7
617 Views
Last Modified: 2013-11-08
Hi,

I have an application in C# which adds custom toolbar to excel. I have a requirement where in I need to load a windows form having a web browser control when one of the buttons of the toolbar is clicked and navigate a web page in that web browser control.

The problem I'm facing is any page navigated from this web browser control is rendering in IE 6.0 format. All the controls in the webpage scrollbars, combo boxes etc. are all rendered in IE 6.0 format when I'm having IE 8.0 in my system.
0
Comment
Question by:pkoivula
  • 4
  • 2
7 Comments
 
LVL 10

Expert Comment

by:John Claes
ID: 34959161
What version does the WebControl Dll have?
You can have an other version of IE installed but still using the older DLL's in your application.

regards

poor beggar
0
 

Author Comment

by:pkoivula
ID: 34959391
Webbrowser is a control of System.Windows.Forms dll whose version is 2.0.50727.3053.

It is working fine when I use the webbrowser in a standalone windows application.
0
 
LVL 33

Expert Comment

by:Todd Gerbert
ID: 34960955
What do you mean by "rendering in IE 6.0 format"?  Have your WebBrowser control navigate to the URL res://ieframe.dll/about.dlg, you should see the Internet Explorer "About" dialog - which will indicate which version of IE the control's using.
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Author Comment

by:pkoivula
ID: 34968547
It means all the controls of the webpage are shown as in IE 6.0 mode. For Example, scrollbars style is gray in IE 6.0  whereas in IE 7.0 or IE 8.0 it is blue. I'm having windows XP Professional in my system.


In my application the excel toolbar is created using a Shared Addin in Visual Studio 2008. When a windows form having webbrowser control is loaded from excel toolbar button click event, the web page is loaded in IE 6.0 mode whatever maybe the version of IE in the system. I have checked this in Windows 7 system also which comes with IE 8.0 as default browser.
I can see the same problem in Windows 7 system also.


But when I'm loading excel toolbar using automation (not COM) addin, the webpage is loading properly (Web browser works as the version of IE in the system). Plz suggest what could be the problem?
0
 

Author Comment

by:pkoivula
ID: 34994661
I got the root cause for the problem that I was facing with the web browser used in a Shared Addin. I thought the problem is with web browser and the web page is rendering in IE 6.0 format since the webpage appeared to be in some old format.

Actually the problem is with Windows form loaded from a button click in a Excel SharedAddin.
Not only the web browser, if we add windows controls like scroll bars (vertical / horizontal), combobox, radio button, checkbox, button, progressbar etc to the windows form, they are having old style at runtime(like vs 2003 controls).

But still no idea about the solution for this problem.

0
 
LVL 33

Accepted Solution

by:
Todd Gerbert earned 500 total points
ID: 35021489
Googling around, it would seem your add-in needs to call System.Windows.Forms.Application.EnableVisualStyles() prior to showing forms.
0
 

Author Comment

by:pkoivula
ID: 35024080
Thank you...it worked
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now