示例#1
0
        public HtmlControl()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();
#if Old
            //link up to before navigate so that we know when the user clicked on something
            //note: this old version of before navigate is being used because of a bug in the.net framework.
            //win this bug is fixed, we should look at switching to using BeforeNavigate2

            //need to get hold of the ActiveX object and then grab this old interface:
            SHDocVw.WebBrowser_V1 axDocumentV1 = m_browser.GetOcx() as SHDocVw.WebBrowser_V1;
            axDocumentV1.BeforeNavigate += new SHDocVw.DWebBrowserEvents_BeforeNavigateEventHandler(OnBeforeNavigate);
#endif
            base.AccNameDefault = "HtmlControl";                // default accessibility name
            // no right-click context menu needed
            this.m_browser.NoDefaultContextMenu = true;
        }