我已经尝试了很多,但无法使其工作:(。我想在同一个主窗口而不是新窗口中打开第二个窗口。
我尝试遵循但没有运气,也许我做错了什么,因为我不擅长编码:(
https://github.com/cefsharp/CefSharp/issues/600
https://github.com/cefsharp/CefSharp/issues/688
https://www.codeproject.com/Articles/1194609/Capturing-a-pop-up-window-using-LifeSpanHandler-an
您能否帮我找到解决方案,以便无论您在任何网页上单击哪个按钮,它都仅在窗口中打开
using CefSharp;
using CefSharp.WinForms;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Threading;
using System.Runtime.InteropServices;
using System.Diagnostics;
using Microsoft.Win32;
namespace Nysus
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
ChromiumWebBrowser chrome;
private void Form1_Load(object sender, EventArgs e)
{
CefSettings settings = new CefSettings();
//Initialize
Cef.EnableHighDPISupport();
Cef.Initialize(settings);
chrome = new ChromiumWebBrowser("http://www.google.com");
this.pContainer.Controls.Add(chrome);
chrome.Dock = DockStyle.Fill;
this.FormBorderStyle = FormBorderStyle.None;
this.WindowState …Run Code Online (Sandbox Code Playgroud)