0

Cefsharp.Winform, when i hide the form the browser loading canceled.

There is two forms: MainForm and BrowserForm( Cefsharp.Winform in this from ). When i call Hide method to hide BrowserFrom , the cefsharp.winform load is canceled.

Hide form code:

private void BrowserForm_AddressChanged(object sender, AddressChangedEventArgs e) {
        var url = new Uri( e.Address );
        if ("login.taobao.com".Equals( url.Host, StringComparison.OrdinalIgnoreCase )) {
            return;
        }

        var browserForm = ( sender as Control ).Parent as BrowserForm;

        if (browserForm.InvokeRequired) {
            browserForm.Invoke( new MethodInvoker( delegate { browserForm.Hide(); } ) );
        }
        else { browserForm.Hide(); }

        if ("myseller.taobao.com".Equals( url.Host, StringComparison.OrdinalIgnoreCase )) {
            browserForm.LoadUrl( "https://law.taobao.com/rulefaces/rule_url_proxy.htm" );
            return;
        }
        if ("law.taobao.com".Equals( url.Host, StringComparison.OrdinalIgnoreCase )) {
            return;
        }

        browserForm.AddressChanged -= BrowserForm_AddressChanged;
        AppController.ExecuteCollectionTask().Wait();
    }

Is there some way to keep load after hide the BrowserFrom?

Cefsharp.Winform version 57.0 .net framework 4.5.2

Thanks.

  • Fork the `MinimalExample`, provide a working example of your problem. Push the changes to `GitHub`. https://github.com/cefsharp/CefSharp.MinimalExample – amaitland Apr 20 '17 at 21:26
  • Demo file [link](https://www.dropbox.com/s/0tbncgmcfuqxde2/CefsharpDemo.zip?dl=0) –  ChaoVer Apr 21 '17 at 02:45
  • @amaitland Example on Dropbox https://www.dropbox.com/s/0tbncgmcfuqxde2/CefsharpDemo.zip?dl=0 –  ChaoVer Apr 21 '17 at 04:28

0 Answers0