【问题标题】:Awesomium WebControl not showingAwesomium WebControl 未显示
【发布时间】:2017-09-15 03:03:14
【问题描述】:

对不起,如果这听起来有点无聊,但我刚刚安装了 Awesomium SDK,添加了对项目的引用,但我在工具箱中找不到“WebControl”。我做错了什么?

【问题讨论】:

    标签: visual-studio-2010 awesomium


    【解决方案1】:

    您所要做的就是运行安装程序以将其卸载并重新安装到程序集文件夹中。

    http://wiki.awesomium.net/getting-started/setting-up-on-windows.html

    【讨论】:

      【解决方案2】:

      这可能会有所帮助,转到您的项目属性并检查目标框架。它应该是 .Net Framework 4 客户端配置文件或更高版本

      【讨论】:

        【解决方案3】:

        您应该创建 WebView,将其添加到表单,设置它位置和大小并设置源 URI! 尝试包含命名空间:

        using Awesomium;
        using Awesomium.Windows.Forms;
        using Awesomium.Core;
        
        static class Program {
        
            static Form1 f1 = new Form1();
            static Form fm = new Form {};
            static WebBrowser wb = new WebBrowser { Dock = DockStyle.Fill};
            //private static WebView wv;
            static WebControl wc = new WebControl{Visible = true};
            //static WebView wv;// = new WebView(fm.Handle);
            [STAThread]
            static void Main(string[] args) {
                //f1.ShowDialog();  return;
        
                wc.ViewType = WebViewType.Window;
                wc.Location = new System.Drawing.Point(0,0);
                wc.Size = new System.Drawing.Size(1000,1000);
                fm.Controls.Add(wc);
                //wv = new WebView(fm.Handle);
                //fm.Controls.Add(wv.con);
                wc.Source = new Uri("https://stackoverflow.com");
                Task k = new Task(delegate {
                    Thread.Sleep(200);
                    try {
                        fm.Invoke(new MethodInvoker(delegate {
                            try {
        
                                MessageBox.Show(wc.Source.ToString());
        
                            } catch {
                                MessageBox.Show("2");
                            }
        
                        }));
                    } catch {
                        MessageBox.Show("1");
                    }
        
                });
                k.Start();
                fm.ShowDialog();
            }//main
        

        【讨论】:

          猜你喜欢
          • 2013-05-18
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2015-04-04
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多