public FormWebBrowser() { IEVersion.BrowserEmulationSet(); InitializeComponent(); initWebForm(); }
public FormWebBrowser(int width, int height, string path) { IEVersion.BrowserEmulationSet(); InitializeComponent(); //------------------------- try { this.webBrowser1.ObjectForScripting = this;//与c#代码通信,这句是关键 } catch (Exception e) { string err = e.Message; } this.ClientSize = new System.Drawing.Size(width, height); this.webBrowser1.Navigate(path); this.TopMost = false; this.Hide(); }