Esempio n. 1
0
        // called from SelfNavigateComplete()
        protected void SetHtmlText(string text)
        {
            if (text == null)
            {
                text = String.Empty;
            }

            if (!IsHandleCreated)
            {
                return;
            }

            if (control != null)
            {
                IHTMLDocument2 document = control.Document;
                if (document != null)
                {
                    if (activate)
                    {
                        DoVerb(Interop.OLEIVERB_UIACTIVATE);
                    }
                    // this way we can provide the FULL HTML incl. <head><style> etc.
                    document.Open("", null, null, null);
                    object[] a = new object[] { text };
                    document.Write(a);
                    document.Close();
                    _document = document;
                    // Without the "Refresh" command, the browser control doesn't
                    // react to links containing the # character in the hyperlink.
                    try {
                        if (text.IndexOf("#") > 0)
                        {
                            document.ExecCommand("Refresh", false, null);
                        }
                    } catch {}
                }
            }
        }
Esempio n. 2
0
        //IHTMLDocument2

        public bool ExecCommand(String cmdID)
        {
            return(mDoc2.ExecCommand(cmdID, true, null));
        }