0

I wonder, is there a way to make internet explorer style none window like wpf application.

Thanks,

Code :

public static void test()
        {

            System.Type oType = System.Type.GetTypeFromProgID("InternetExplorer.Application");

            SHDocVw.InternetExplorer ie = Activator.CreateInstance(oType) as SHDocVw.InternetExplorer;

            ie.MenuBar = false;
            ie.ToolBar = 0;
            ie.StatusBar = false;
            ie.AddressBar = false;

            ie.Width = 800;
            ie.Height = 600;

            ie.Visible = true;
            ie.Navigate("http://m.naver.com");

        }
Jay
  • 1,317
  • 4
  • 16
  • 40
kimtk
  • 27
  • 7
  • What did you try? The code you are showing is not trying to set any style. – Sheridan Apr 04 '14 at 13:50
  • i want to remove internet explorer frame such as border, captions. it's like none style window in wpf application. – kimtk Apr 05 '14 at 04:01

1 Answers1

0

I don't know any way to achieve that with SHDocVw.InternetExplorer, however you could use System.Windows.Controls.WebBrowser:

Window window = new Window();
window.WindowStyle = WindowStyle.None;
window.ResizeMode = ResizeMode.NoResize;
window.Width = 800;
window.Height = 600;

WebBrowser webBrowser = new WebBrowser();
webBrowser.Navigate("http://m.naver.com");

window.Content = webBrowser;
window.Show();

And remember to Dispose your WebBrowser object after you are done with it if you don't want a memory leak.

Raúl Nuño
  • 313
  • 2
  • 12
  • thanks for reply. if i use webbrowser, some errors occur due to javascript files from original website such as "m.naver.com" or any site using javascript. so i need to find other solutions. – kimtk Apr 05 '14 at 03:59
  • If this is the only problem, you can [supress](http://stackoverflow.com/a/13194230/1378699) or [fix](http://social.msdn.microsoft.com/Forums/vstudio/en-US/72ffeddd-5d02-491b-8b7b-6740befc46a0/webbrowser-error-when-using-external-javascript?forum=wpf) the JavaScript errors. – Raúl Nuño Apr 08 '14 at 15:53
  • oh..Thanks for your kind explanation. I'd never been realized to use supress method without you. Thanks!! I hope you someday get more benefits from others because you did good works. – kimtk Apr 08 '14 at 17:14