System.Windows.Forms.HtmlDocument.CreateElement(string)

Here are the examples of the csharp api class System.Windows.Forms.HtmlDocument.CreateElement(string) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

1. Example

Project: dnscrypt-win-client
Source File: HTMLPanel.cs
View license
private void AddDetails(object sender, EventArgs e)
        {
            WebBrowser browser = (WebB/n ..... /n //View Source file for more details /n }

2. Example

Project: GEDKeeper
Source File: GKMapBrowser.cs
View license
private void gm_ExecScript(string script)
        {
            script = script.Trim();
            if (string.IsNullOrEmpty(script)) return;

            #if !__MonoCS__
            try
            {
                HtmlElement script1 = Document.GetElementById("gkScript");

                if (script1 == null) {
                    HtmlElement head = Document.GetElementsByTagName("head")[0];
                    script1 = Document.CreateElement("script");
                    script1.Id = "gkScript";
                    head.AppendChild(script1);
                }

                script1.SetAttribute("text", "function gkFunc() { " + script + " }");
                Document.InvokeScript("gkFunc");

                //string jCode = "alert("Hello");"
                //webBrowser1.Document.InvokeScript("eval", new object[] { jCode });
                
                //var jsCode="alert('hello world from injected code');";
                //WebBrowser.Document.InvokeScript("execScript", new Object[] { jsCode, "JavaScript" });
                
                //mshtml.IHTMLWindow2 win = (mshtml.IHTMLWindow2)Document.Window.DomWindow;
                //if (win != null) {
                //    win.execScript(script, "JavaScript");
                //}
            }
            catch (Exception ex)
            {
                Logger.LogWrite("GKMapBrowser.gm_ExecScript(): " + ex.Message);
            }
            #endif
        }