0

我正在使用Awesomium尝试在我的 Windows 窗体应用程序中实现网页。

我已经使用了 awesomium .NET 示例,但我只是没有使用我的 homeurl 获得我的标签。

当我运行我的项目时,状态栏在我的表单中浮动,没有其他任何事情发生。

任何人都知道我在哪里可以了解如何做到这一点或知道可能是什么问题?

    public Laboratory() {
        WebCoreConfig webConfig = new WebCoreConfig() {
            SaveCacheAndCookies = true,
            HomeURL = "http://www.google.com",
            LogLevel = LogLevel.Verbose
        };

        // Using our executable as a child rendering process, is not
        // available when debugging in VS.
        if (!Process.GetCurrentProcess().ProcessName.EndsWith("vshost")) {
            // We demonstrate using our own executable as child rendering process.
            // Also see the entry point (Main function) in Program.cs.
            webConfig.ChildProcessPath = WebCoreConfig.CHILD_PROCESS_SELF;
        }
        WebCore.Initialize(webConfig);

        InitializeComponent();
    }

    #region methodes

    #region OpenTab
    internal WebDocument OpenTab(string url = null, string title = null) {
        WebDocument doc = String.IsNullOrEmpty(url) ? new WebDocument() :
            String.IsNullOrEmpty(title) ? new WebDocument(url) : new WebDocument(url, title);
        doc.Show(dockPanel);

        return doc;
    }
    #endregion

    protected override void OnLoad(EventArgs e) {
        base.OnLoad(e);
        this.OpenTab();
    }

Windows 窗体应用程序

4

2 回答 2

0

我已经完全重做了左侧面板,并使用了另一个下载示例,它就像一个魅力。这是非常基本的,但现在就可以了。

于 2012-02-24T12:39:00.653 回答
0

我也有同样的问题,但我设计了一个解决这个问题的方法。我实现了需要在每个选项卡(根据示例的 WebDocument 页面)上呈现的主浏览器引擎作为用户控件。然后我在 mainForm 中使用了 DockPannel 。

所以我创建了一个用户控件的实例,然后将它添加到 DockPannel 的一个实例中,因此它创建了一个具有所需结构的选项卡。

如果您仍然没有找到解决方案或有问题,请留下评论,我会输入一些代码来帮助您。

于 2012-03-13T15:52:32.047 回答