CefSharp文档参考https://github.com/cefsharp/CefSharp
使用Winform作为载体
包:CefSharp.WinForms 89.0.170
Framework:net4.8
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.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Timers;
using System.Windows.Forms;
namespace ScreenSlice
{
public partial class OnlyOne : Form
{
private ChromiumWebBrowser c1;
private Form1 returnForm1 = null;
public OnlyOne(Form1 F1)
{
InitializeComponent();
//FormBorderStyle.None 时候最大化不遮盖任务栏 使得statusStrip得以显示
this.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
c1 = new ChromiumWebBrowser(CommonHelper.homeUrl);
c1.LifeSpanHandler = new OpenPageSelf();
c1.MenuHandler = new MenuHandler();
panel1.Controls.Add(c1);
returnForm1 = F1;
}
private void OnlyOne_Load(object sender, EventArgs e)
{
string xmlFilePath = Application.StartupPath + @"\Resource\0.config";
XmlHelper xH