-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathKBrowser.cs
32 lines (28 loc) · 855 Bytes
/
KBrowser.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
namespace KSharpEditor
{
public class KBrowser : System.Windows.Forms.WebBrowser
{
private SHDocVw.IWebBrowser2 Iwb2;
public KBrowser()
{
NewWindow += KBrowser_NewWindow;
}
private void KBrowser_NewWindow(object sender, System.ComponentModel.CancelEventArgs e)
{
KBrowser kb = sender as KBrowser;
if (kb == null) return;
Navigate(kb.StatusText);
}
protected override void AttachInterfaces(object nativeActiveXObject)
{
Iwb2 = (SHDocVw.IWebBrowser2)nativeActiveXObject;
Iwb2.Silent = true;
base.AttachInterfaces(nativeActiveXObject);
}
protected override void DetachInterfaces()
{
Iwb2 = null;
base.DetachInterfaces();
}
}
}